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

mock: fix erroneous calledWithArgs messages #1258

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kleinerhund
Copy link

Summary

AssertCalled(...) displays output from other methods when the assertion fails.

Changes

Added a check that the called method name matches that of the asserted method name. Same as in AssertNumberOfCalls(...).

Motivation

AssertCalled(...) fails for the correct assertion, however the output displayed can sometimes indicate that the method was called with arguments from other methods.

Related issues

Closes #1144

@dolmen dolmen added the pkg-mock Any issues related to Mock label Oct 16, 2023
@dolmen dolmen changed the title fix erroneous calledWithArgs messages mock: fix erroneous calledWithArgs messages Oct 16, 2023
@brackendawson brackendawson added this to the v1.8.6 milestone Feb 24, 2024
@brackendawson brackendawson modified the milestones: v1.9.1, v1.10 Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg-mock Any issues related to Mock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mock: AssertCalled confuses separate method calls in assert message
4 participants