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

Mark Wilden mark at mwilden.com
Wed Nov 5 15:10:25 EST 2008


On Wed, Nov 5, 2008 at 11:42 AM, David Chelimsky <dchelimsky at gmail.com>wrote:


> Looks like you can't stub anything on a Fixnum because of the way
> RSpec's mocking works.
>
> >> require 'spec/mocks'
> => true
> >> 1.stub!(:foo)
> TypeError: no virtual class for Fixnum
>

What I can't figure out is this:

>> 1.day
=> 1 day

>> 1.day.class
=> Fixnum

Is 1.day an ActiveSupport::Duration or a Fixnum?

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


More information about the rspec-users mailing list