[rspec-users] Stub activerecord find given instance?

Saverio Miroddi lists at ruby-forum.com
Mon Feb 8 18:05:55 EST 2010

Got at the bottom of it - as suggested, 
object.stub(:method).with(:value).and_return(:ret) multiple times with 
different :value [s], though it causes calls to :method to fail unless 
it has one the :value [s] passed.


Saverio Miroddi wrote:
> Thanks for the help - I'm going to look directly at the source code,
> though of course the recommendation of improving the tests rather than
> stretch the api itself is very welcome!
> If I'm going to find anything notable (I have kind of a hunch that I
> will), I'll post it.
> Saverio
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list