[rspec-users] Mocks and Refactoring - doing it wrong?

Scott Taylor mailing_lists at railsnewbie.com
Thu Oct 30 16:26:07 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?

Of course, this also depends on what context.

Often in Rails I find myself using mocks when I have no need to - the  
dependent object is already built, and I'm using a mock just so that I  
don't hit the database at all.


More information about the rspec-users mailing list