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

Allow redefine when parent provides the sub #23

Merged
merged 1 commit into from
May 5, 2018

Conversation

atoomic
Copy link
Contributor

@atoomic atoomic commented May 3, 2018

Try the ISA chain to check if the sub exists in one of the parent.

Note that this is a behavior change proposal, I think it's a good option to let redefine check for parents by default. But discussion is open if we prefer to add an option or provide another name to the function to preserve backward compatibility with the original behavior.

Thanks for considering such an option
nicolas

Try the ISA chain to check if the sub exists
in one of the parent.
@toddr
Copy link
Contributor

toddr commented May 4, 2018

This makes sense to me. Otherwise you're expecting the person writing the mock to determine the inheritance origin of a method and mock the relevant class which has much more effect than they wanted. They just wanted to mock the method in the derived class.

This patch seems to make Test::MockModule more DWIM and thus desirable.

@geofffranks geofffranks merged commit f8f524f into geofffranks:master May 5, 2018
@geofffranks
Copy link
Owner

Released in v0.14 which should be on its way to cpan now. Thanks for this!

@atoomic
Copy link
Contributor Author

atoomic commented May 7, 2018

Thanks for considering it and taking care of it so fast.
really appreciate, will start using it in the next hours :-)

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.

None yet

3 participants