<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Timecop: Freeze Time in Ruby for Better Testing</title>
	<atom:link href="http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/</link>
	<description>News and updates from the people at SmartLogic Solutions</description>
	<lastBuildDate>Sat, 17 Dec 2011 12:57:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: John Trupiano</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-4983</link>
		<dc:creator>John Trupiano</dc:creator>
		<pubDate>Tue, 09 Nov 2010 14:41:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-4983</guid>
		<description>Wow, that&#039;s awesome Graeme!</description>
		<content:encoded><![CDATA[<p>Wow, that&#8217;s awesome Graeme!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graeme Mathieson</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-4981</link>
		<dc:creator>Graeme Mathieson</dc:creator>
		<pubDate>Tue, 09 Nov 2010 08:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-4981</guid>
		<description>Part of our system performs daily recalculations for each day between an event happening and today. It also has to be able to account for changes in tax law over the past 4 years. This combination has meant our test suite gets slower every day, since we have tests verifying correct behaviour immediately before and after tax law changes.

Refactoring it to avoid the date sensitivity is a big job, and one that we&#039;ve been putting off for a while (though we will still get to it one day!). Incorporating Timecop took 10 minutes of dev work (most of which was identifying the hotspots) and has shaved 90 seconds (120s down to 30s) from one set of tests. Quick win! Thank you!</description>
		<content:encoded><![CDATA[<p>Part of our system performs daily recalculations for each day between an event happening and today. It also has to be able to account for changes in tax law over the past 4 years. This combination has meant our test suite gets slower every day, since we have tests verifying correct behaviour immediately before and after tax law changes.</p>
<p>Refactoring it to avoid the date sensitivity is a big job, and one that we&#8217;ve been putting off for a while (though we will still get to it one day!). Incorporating Timecop took 10 minutes of dev work (most of which was identifying the hotspots) and has shaved 90 seconds (120s down to 30s) from one set of tests. Quick win! Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hammed</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-3629</link>
		<dc:creator>Hammed</dc:creator>
		<pubDate>Sat, 16 Jan 2010 01:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-3629</guid>
		<description>One of the most useful testing plugins for rails! cheers</description>
		<content:encoded><![CDATA[<p>One of the most useful testing plugins for rails! cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lewis Hoffman</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-2923</link>
		<dc:creator>Lewis Hoffman</dc:creator>
		<pubDate>Wed, 17 Jun 2009 18:50:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-2923</guid>
		<description>Adding a notification cron job to Wagn (wagn.org) &amp; this will be perfect for building the tests, thank you!</description>
		<content:encoded><![CDATA[<p>Adding a notification cron job to Wagn (wagn.org) &amp; this will be perfect for building the tests, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Trupiano</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-703</link>
		<dc:creator>John Trupiano</dc:creator>
		<pubDate>Wed, 24 Dec 2008 06:16:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-703</guid>
		<description>Hey Scott, glad Timecop is working out for you!

To all commenters (in particular anonymouse), take note that I&#039;ve release version 0.2.0, which most importantly provides the ability to either &quot;freeze&quot; or &quot;rebase&quot; time (as opposed to only 0.1.0, which only froze time).  See the blog post (http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/) or check out the project on github: http://github.com/jtrupiano/timecop</description>
		<content:encoded><![CDATA[<p>Hey Scott, glad Timecop is working out for you!</p>
<p>To all commenters (in particular anonymouse), take note that I&#8217;ve release version 0.2.0, which most importantly provides the ability to either &#8220;freeze&#8221; or &#8220;rebase&#8221; time (as opposed to only 0.1.0, which only froze time).  See the blog post (<a href="http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/" rel="nofollow">http://blog.smartlogicsolutions.com/2008/12/24/timecop-2-released-freeze-and-rebase-time-ruby/</a>) or check out the project on github: <a href="http://github.com/jtrupiano/timecop" rel="nofollow">http://github.com/jtrupiano/timecop</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Moe</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-660</link>
		<dc:creator>Scott Moe</dc:creator>
		<pubDate>Sat, 13 Dec 2008 19:40:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-660</guid>
		<description>Awesome! We&#039;re building a site for filing sales tax and this is exactly what we need to build useful tests that will work now and a year from now.</description>
		<content:encoded><![CDATA[<p>Awesome! We&#8217;re building a site for filing sales tax and this is exactly what we need to build useful tests that will work now and a year from now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Trupiano</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-583</link>
		<dc:creator>John Trupiano</dc:creator>
		<pubDate>Fri, 21 Nov 2008 16:23:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-583</guid>
		<description>Francois, Aaron, thanks for the kudos.  I hope you&#039;re finding the gem useful.  It&#039;s working very well for us on several projects.

anonymouse: time will not continue to move forward, and as you point out, this does reduce the usable scope for the gem.  I would LOVE to put this feature into Timecop, but it&#039;s not something I&#039;ve looked into.

I imagine a usable solution would involve the following:

  1) Take the new time/date from the #travel() function and store it.
  2) Compute deltas (offsets) for Time.now, DateTime.now and Date.today
  3) Mock Time.now, DateTime.now and Date.today to return the current time + those deltas (rather than just returning the original mock)

It sounds do-able to me, perhaps a project for a free weekend!  If you feel so inclined, the project is available on github (http://github.com/jtrupiano/timecop).  Otherwise, it&#039;s certainly something to put on my to-do list.

Thanks for checking in.</description>
		<content:encoded><![CDATA[<p>Francois, Aaron, thanks for the kudos.  I hope you&#8217;re finding the gem useful.  It&#8217;s working very well for us on several projects.</p>
<p>anonymouse: time will not continue to move forward, and as you point out, this does reduce the usable scope for the gem.  I would LOVE to put this feature into Timecop, but it&#8217;s not something I&#8217;ve looked into.</p>
<p>I imagine a usable solution would involve the following:</p>
<p>  1) Take the new time/date from the #travel() function and store it.<br />
  2) Compute deltas (offsets) for Time.now, DateTime.now and Date.today<br />
  3) Mock Time.now, DateTime.now and Date.today to return the current time + those deltas (rather than just returning the original mock)</p>
<p>It sounds do-able to me, perhaps a project for a free weekend!  If you feel so inclined, the project is available on github (<a href="http://github.com/jtrupiano/timecop" rel="nofollow">http://github.com/jtrupiano/timecop</a>).  Otherwise, it&#8217;s certainly something to put on my to-do list.</p>
<p>Thanks for checking in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymouse</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-582</link>
		<dc:creator>anonymouse</dc:creator>
		<pubDate>Fri, 21 Nov 2008 16:17:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-582</guid>
		<description>So, does time still move forward after a Time.travel? That would be sweet, since some things may use time internally for benchmarking/timeouts/etc.</description>
		<content:encoded><![CDATA[<p>So, does time still move forward after a Time.travel? That would be sweet, since some things may use time internally for benchmarking/timeouts/etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron H.</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-574</link>
		<dc:creator>Aaron H.</dc:creator>
		<pubDate>Wed, 19 Nov 2008 19:29:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-574</guid>
		<description>This is AWESOME.  I work on several apps that have time as a key component and this is going to be SO useful.  THANK YOU!</description>
		<content:encoded><![CDATA[<p>This is AWESOME.  I work on several apps that have time as a key component and this is going to be SO useful.  THANK YOU!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: François Beausoleil</title>
		<link>http://blog.smartlogicsolutions.com/2008/11/19/timecop-freeze-time-in-ruby-for-better-testing/comment-page-1/#comment-573</link>
		<dc:creator>François Beausoleil</dc:creator>
		<pubDate>Wed, 19 Nov 2008 19:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.smartlogicsolutions.com/?p=360#comment-573</guid>
		<description>Thank you very much for that.  I had started such a library, but I stopped after I coded a couple of test cases.  I&#039;ll enjoy using a good solution, instead of my half-baked one :)</description>
		<content:encoded><![CDATA[<p>Thank you very much for that.  I had started such a library, but I stopped after I coded a couple of test cases.  I&#8217;ll enjoy using a good solution, instead of my half-baked one :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

