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

Duncan Beevers duncanbeevers at gmail.com
Thu Sep 6 15:36:37 EDT 2007

A cheap way to do this would be to move the methods that actually test
the network functionality to their own instance of
Test::Unit::TestCase without the stubbing setup.

On 9/6/07, Jay Levitt <lists-mocha at shopwatch.org> wrote:
> 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
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer

More information about the mocha-developer mailing list