expectations changing visibility of methods
Reported by James Mead | May 16th, 2010 @ 11:37 PM
On behalf of krist0ff (from GitHub issue http://github.com/floehopper/mocha/issues#issue/3)
if I have a private method on object, and I set an expectation on it:
the visibility of this method is changed to public.
If I have any code, that is checking for visibility of methods, ie:
then obviously mocha will change the behavior of this code.
temporarily, I work around it with
object.expects(:private_method) object.class_eval "private :private_method" # fix for mocha issues
which works - that means that mocha doesn't need to make it public, right?