[mocha-developer] problem with using any_instance

James Mead jamesmead44 at gmail.com
Sun Apr 1 17:25:51 EDT 2007

It looks like the critical aspect of your failing test is the fact that you
are stubbing a private method.

Originally Mocha did not allow stubbing of private methods. Somehow
accidentally it became allowed. Stubbing private methods isn't a good idea,
because it couples the test to the internals of the class.

There seems to be a bug with stubbing a private method. I'll look into it,
but in the meantime you can fix your test if you are able to make the
stubbed method public.


More information about the mocha-developer mailing list