8000 Enable mocking a trait which has a final method by jeremyrsmith · Pull Request #132 · scalamock/scalamock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enable mocking a trait which has a final method #132

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

Conversation

jeremyrsmith
Copy link

I did this because currently, attempting to mock a class or trait which has a final method results in a compilation failure. I think it's better to say that you simply can't mock the final method itself, but you can still mock other methods. This pull request just filters final methods out from the methods that the mock attempts to implement.

@dvgica
Copy link
dvgica commented Jun 3, 2016

The trade-off this PR makes is that trying to stub/mock a final method no longer gives you a compile error. Instead, it throws a NoSuchMethodError at runtime. I think this is fine for the time being, and we've merged a slightly modified version of this PR here: #142 (thanks for the fix!)

barkhorn pushed a commit that referenced this pull request Jan 7, 2017
@barkhorn barkhorn added this to the v3.5.0 milestone Jan 7, 2017
@barkhorn barkhorn removed the triage label Jan 7, 2017
@barkhorn barkhorn closed this Jan 7, 2017
barkhorn pushed a commit that referenced this pull request Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0