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?
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
A mocking & stubbing library for Ruby.
* <a href="http://github.com/floehopper/mocha">GitHub repository</a>
* <a href="http://mocha.rubyforge.org">Documentation</a>
* <a href="http://groups.google.com/group/mocha-developer">Mailing List</a>