[rspec-users] Stubbing times: #from_now et al.

Mark Wilden mark at mwilden.com
Wed Nov 5 15:39:36 EST 2008


On Wed, Nov 5, 2008 at 12:26 PM, Nick Hoffman <nick at deadorange.com> wrote:

> On 2008-11-05, at 15:10, Mark Wilden wrote:
>
>> What I can't figure out is this:
>>
>> >> 1.day
>> => 1 day
>>
>> >> 1.day.class
>> => Fixnum
>>
>> I've no idea why 1.day.class returns Fixnum though..
>

Yeah, I'd looked at the code. Why #class returns Fixnum was my question,
actually. Something to do with coercion, maybe.

The other thing is that if it were simply a Duration, I'd expect you to be
able to stub it.

///ark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081105/489d7d95/attachment.html>


More information about the rspec-users mailing list