[rspec-users] Odd Date-based spec failing

Tom Stuart tom at experthuman.com
Tue Jul 1 08:23:02 EDT 2008


On 1 Jul 2008, at 13:06, Matt Darby wrote:
> When run via 'rake spec:models'
> Date.today = 2008-07-01
> self.start_date = 0825-09-17
> self.end_date = 2008-07-02
>
> Pretty obvious what the bug is suddenly, but would cause this?

Not a solution, but a clue:

$ ./script/console
 >> Date.today.minus_with_duration(5.days)
=> Thu, 26 Jun 2008
 >> Date.today.minus_without_duration(5.days.to_i)
=> Sun, 17 Sep 0825

Is this a load-order problem? Perhaps  
ActiveSupport::CoreExtensions::Date::Calculations isn't kicking in  
correctly.

Cheers,
-Tom


More information about the rspec-users mailing list