[mocha-developer] Removing/overriding/unstubbing a stub?

Jay Levitt lists-mocha at shopwatch.org
Thu Sep 6 14:14:54 EDT 2007

We're using Mocha stubs to stub out a slow-performing network request in 
a Test::Unit class.  But naturally, we don't want to stub it out in the 
few tests that actually verify the functionality of that network request.

Is there a way to do the stub in "setup", but override it for the few 
tests that need the original functionality?

(I realize that in this case, the best solution is to refactor the class 
under test, and pull the network functionality into its own class.  But 
I can imagine there might be other scenarios where I'd want to do this too.)

Jay Levit

More information about the mocha-developer mailing list