[mocha-developer] Object.stubs doesn't seem to work.
jonathan.stott at gmail.com
Mon Jul 30 10:15:47 EDT 2007
I'm using Mocha 0.5.3 and I want to stub out a call to Time.now, just
like the example in the post
However, trying it in irb gets me the following error:
>> require 'mocha'
>> Time.stubs(:now).returns(Time.parse('Thu Feb 01 00:00:00 UTC 2007'))
NoMethodError: undefined method `stub' for nil:NilClass
Has this way of stubbing been depreciated between 0.5.0 and 0.5.3, and
if so, what is the new way of stubbing for an Object.method ?
More information about the mocha-developer