[rspec-users] Mocking with Calculated Results

s.ross cwdinfo at gmail.com
Mon Apr 30 17:58:10 EDT 2007

This would be cool if it worked, but it seems not to. I think there  
may be a "last one wins" behavior to class method mocking. Any other  


On Apr 30, 2007, at 2:11 PM, James Hillyerd wrote:

> But that doesn't sound like it would help you.   What about:
> Setting.should_receive(:find).with 
> (:all).any_number_of_times.and_return([@setting, @setting])
> Setting.should_receive(:find).with(1).any_number_of_times.and_return 
> (@setting)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070430/913348e3/attachment.html 

More information about the rspec-users mailing list