Displaying 1 result from an estimated 1 matches for "serverbusy".
Did you mean:
serverbug
2007 Mar 09
0
Fwd: Mocha raise exception first call, return value second call
...First example, I''m trying to connect to a server and test the case where
> my first attempt raises a ''Server busy'' exception or something of that
> sort. So I wait, then retry and then the second time the connection is
> successful.
results = [ lambda { raise ServerBusy }, lambda { return true } ]
object.stubs(:connect).returns { lambda { results.shift.call } }
You might be interested in another recent thread
(http://rubyforge.org/pipermail/mocha-developer/2007-March/000225.html
) which discusses how we might come up with a syntax to make this easier.
--
James....