Q: How do you stub a method call for a rails unit test such that it returns a…

Filed Under (Ruby) by admin on 07-06-2008

Tagged Under : ,

Q: How do you stub a method call for a rails unit test such that it returns a different value the second time it is called? A:  stubs(:foo).returns(1,2) returns 1 the first call, 2 the second, etc.

Post a comment