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: clear call from NotBefore expectations on Unset() #1572

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

Conversation

st3penta
Copy link

@st3penta st3penta commented Mar 8, 2024

Summary

The Call.Unset method was not properly clearing the dependency established by the CallB.NotBefore(CallA) method, which stipulates that CallA should precede CallB. Consequently, the expectations for CallB were failing because it was still anticipating CallA.

Changes

This PR adds the field requiredBy to the Call object, that tracks the dependent Call instances (e.g: CallB, in the above example).
This field is used in the Unset method to clear the NotBefore expectations from the dependent calls.

Related issues

Closes #1542

@dolmen dolmen added bug pkg-mock Any issues related to Mock labels Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pkg-mock Any issues related to Mock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mock: Call.NotBefore still expects calls removed with Call.Unset
2 participants