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

James Mead jamesmead44 at gmail.com
Fri Sep 21 12:21:30 EDT 2007

Cool. Thanks.

On 14/09/2007, Jay Levitt <lists-mocha at shopwatch.org> wrote:
> On 9/13/2007 7:32 AM, James Mead wrote:
> > Personally I'm not a big fan of the setup method. I agree with Duncan
> > that two separate test cases is one way to go. Alternatively you could
> > move the stubbing out of the setup method and into invidual test
> > methods and only add it to the ones that need it - I think this has
> > the benefit of being clearer and more explicit, but it will depend a
> > bit on how many test methods need the stubbed method.
> Yeah, that's how we initially coded it, but calling the same stub 25
> times out of 28 tests felt pretty nasty!
> But for me, refactoring the test (and probably the functionality) into
> two classes solves the problem so far.  I'll yell again if there's a
> case where it doesn't or where I wish it weren't needed.
> Jay
> _______________________________________________
> mocha-developer mailing list
> mocha-developer at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mocha-developer


More information about the mocha-developer mailing list