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
Add capture argument matcher #1020
Conversation
If approved, glad to add a section to the documentation. 👍 |
Love it 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks! 👍
OMG, this looks so cool! |
@robertbasic great! Shall I open an accompanying PR for the docs? |
@jasonmccreary maybe add it to this one? Either works fine, thanks :) |
@robertbasic oh, der, it's a monorepo. Will do. 👍 |
@robertbasic took a stab at writing some documentation. Let me know. |
@jasonmccreary looks good, thanks! |
@robertbasic Yay! Any chance for tagging a release. Would love to tweet/demo this new matcher afterward. 👍 |
@jasonmccreary I need to catch up on the changelog and then to tag a release. Early next week as it stands now, that ok? |
@roberbase, Of course. I'll keep an eye out and do another tweet once it's tagged. |
This adds a simple closure argument matcher which will capture the argument into a local variable. This provides an easy way to store an argument passed to a mocked method for more complex validation without having to wrap all the logic inline within a
Mockery::on()
closure.Example: