Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

expectations changing visibility of methods

#67

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:

object.expects(:private_method)

the visibility of this method is changed to public.
If I have any code, that is checking for visibility of methods, ie:

if private_methods.include?(:private_method)

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?

Reported by James Mead · May 16th, 2010 @ 11:37 PM

State: open
Milestone: none
Assigned to: James Mead James Mead

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.