[rspec-users] [cucumber] Cucumber and Chronic

Stephen Eley sfeley at gmail.com
Mon Mar 2 00:07:31 EST 2009

On Sun, Mar 1, 2009 at 6:30 PM, Mark Wilden <mark at mwilden.com> wrote:
> On Sun, Mar 1, 2009 at 11:07 AM, Mark Wilden <mark at mwilden.com> 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:

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 (sfeley at gmail.com)
   ESCAPE POD - The Science Fiction Podcast Magazine

More information about the rspec-users mailing list