Is there a way to undo Mocha stubbing of any_instance in Test::Unit

Posted by Craig Walker on Stack Overflow See other posts from Stack Overflow or by Craig Walker
Published on 2010-05-24T01:37:57Z Indexed on 2010/05/24 1:40 UTC
Read the original article Hit count: 393

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about ruby

Related posts about mocking