[rspec-users] Mocks and Refactoring - doing it wrong?
Scott Taylor
mailing_lists at railsnewbie.com
Thu Oct 30 16:24:46 EDT 2008
On Oct 30, 2008, at 4:05 PM, Pat Maddox wrote:
> Scott Taylor <mailing_lists at railsnewbie.com> writes:
>
>> Actually, I take back my previous comment. Where would you stub a
>> method on an object where the method *isn't* even loaded by further
>> (or previous) stubbing?
>>
>> Any concrete examples come to mind?
>
> How about if you haven't implemented that object yet?
It would only work if given a concrete class name (i.e. mock(Foo) as
opposed to mock('foo'))
No idea why you couldn't pass a flag for regression testing:
mock(Foo, :check_methods => true)
Scott
More information about the rspec-users
mailing list