On Sun, Mar 1, 2009 at 6:30 PM, Mark Wilden <[email protected]> wrote:
> On Sun, Mar 1, 2009 at 11:07 AM, Mark Wilden <[email protected]> wrote:
>>
>> Just be careful when when basing durations from "now" that daylight
>> savings time doesn't affect anything.
>
> Along the same lines, don't write tests that assume 1.month.ago was <
> 29 days ago, or specs could start failing in March (as just happened
> with us). :)

You wouldn't happen to be on the Microsoft Zune development team,
would you?  >8->

For date testing, I've just discovered and successfully used Notahat's
"time_travel" plugin:
http://github.com/notahat/time_travel/

It's essentially a scoped override for Time.now, so that any code you
pass it executes as if the current time is frozen at whatever you tell
it.  This makes repeatable testing much, much simpler.  This is the
same guy who developed Machinist (my preferred fixture/factory tool)
and not_a_mock, which I used for a little while before I abandoned
mocking.  >8->  So...yeah.  He does good stuff.


-- 
Have Fun,
   Steve Eley ([email protected])
   ESCAPE POD - The Science Fiction Podcast Magazine
   http://www.escapepod.org
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to