From: Raymond O'connor Date: 2007-02-23T14:57:31+09:00 Subject: Mocha test retry to connect up to 10 times I'm writing a script to connect to an external server. The problem is that the server can be flaky and respond with an error code on some requests. When the response I get is an error I would like to retry connecting. If I retry 10 times and fail to connect, I just abort. With mocha I can test the case where each of the 10 attempts receives an error code, but I can't figure out a way to stub HTTP so that it will return an error only 1 or 2 times, and then return a success. Anyone know a good way to test receiving an error a few times and then receiving a success? Any help would be greatly appreciated, thanks! -- Posted via http://www.ruby-forum.com/.