[rspec-users] stubbing gets undone?

Fearless Fool lists at ruby-forum.com
Wed Feb 16 14:37:45 EST 2011


Scott Taylor wrote in post #981963:
> Is #unstub being called at any point?
> Scott

No, but I think I see what's happening: I'm stubbing a particular 
(in-memory) instance of an AR.  Later on in my code, the same AR is 
fetched, but now has a different in-memory address, and thus isn't 
subject to stubbing.  (Is my analysis plausible?)

So my new question is: can I stub Premise#lookup_stuff_on_the_web for 
all objects?  (I could just set up WebMock to return a specific 
response, but it's a complex data structure and it would be much cleaner 
to stub Premise#lookup_stuff_on_the_web instead.)

- ff

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list