Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubbing non-public method should use same visibility #150

Closed
floehopper opened this issue Apr 15, 2013 · 1 comment
Closed

Stubbing non-public method should use same visibility #150

floehopper opened this issue Apr 15, 2013 · 1 comment
Assignees
Milestone

Comments

@floehopper
Copy link
Member

Maybe? Or maybe stubbing a non-public method is a code smell?

See https://github.com/ryanong/spy

@floehopper
Copy link
Member Author

Stubbing a non-public method probably is a code smell, but given that it is possible, it would probably be less surprising if the stub had the same visibility as the original method.

Also we already cater for those who think it's a code smell, by providing the Mocha::Configuration.prevent(:stubbing_non_public_method) option.

Fixing this might break existing tests, so it probably requires at least a minor version increment, if not a major version increment (as per semantic versioning).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant