[rspec-users] Odd Date-based spec failing

Scott Taylor mailing_lists at railsnewbie.com
Thu Jul 3 11:06:05 EDT 2008


On Jul 3, 2008, at 8:27 AM, Matt Darby wrote:

> On Jul 1, 11:21 am, Matt Darby <m... at matt-darby.com> wrote:
>> On Jul 1, 2008, at 8:23 AM, Tom Stuart wrote:
>>
>>> $ ./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.
> Anyone else have thoughts on this?

Yeah - use the debugger (ruby-debug) and the failing test case:

it "should have 5.days as the proper fixnum" do
   require 'rubygems'; require 'ruby-debug'; debugger
   5.days.to_i.should == 5.days
end

Scott


More information about the rspec-users mailing list