[rspec-users] Specs of code that use Time.now

Ashley Moran work at ashleymoran.me.uk
Tue Feb 13 12:50:10 EST 2007

On 13 Feb 2007, at 16:15, Courtenay wrote:

> Personally I like to put this in spec_helper
> def Time.now
>   Time.local(2006,12,01,0,0,0)
> end
> Then all dates are fixed (1 day from now is 2006-12-02 for example).
> No clue if this is best practise, works well here though.

Does this not interfere with RSpec?  I noticed it calling Time.now  
four times without any code on my part.  I suppose something has to  
give though


More information about the rspec-users mailing list