Jul 26, 2011, 7:13:11 PM7/26/11
does anybody know whether it is possible with Mocha to stub a method
call only with a specific paramter and to let all other method calls
go through and return the regular value?
Here is some code to further explain the problem
What I would like to have is that MyObject.my_method("A") should
return "bar" and all other invocations of that method (e.g.
MyObject.my_method("B")) should return the regular "foo-B", and so
on. But what happens with only the stub above is that I get an
"unexpected invocation: MyObject.my_method("B")" error :(
Does anybody have an idea?