Take the 2-minute tour ×  Much like this question, I too am
using Ryan Bates's nifty_scaffold. It has the desirable aspect
of using Mocha's any_instance method to force an "invalid" state
in model objects buried behind the controller.  Unlike the
question I linked to, I'm not using RSpec, but Test::Unit. That
means that the two RSpec-centric solutions there won't work for
me.  Is there a general (ie: works with Test::Unit) way to
remove the any_instance stubbing? I believe that it's causing a
bug in my tests, and I'd like to verify that.  share|improve
this question add comment  2 Answers  up vote 11 down vote
accepted  As it happens, Mocha 0.10.0 allows unstubbing on
any_instance().  str = "Not Stubbed!" puts str.to_s   #
"Stubbed!" puts str.to_s   # "Not Stubbed!" share|improve this
answer add comment  Mocha does not provide such a functionality.
However you can implement it yourself.  The first thing we
should know about mocha is that mocha actually replaces the
original methods when you stub them. So in o