This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
Why do unexpected method calls cause test failure ? #105
Closed
Description
As a user of mocks, I would like to have the possibility to choose which calls I really need to verify.
Therefore, unexpected method calls should issue only a warning in the test fail, in should not cause the test to fail.
ie, in controller.go, instead of:
expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args)
if err != nil {
origin := callerInfo(2)
ctrl.t.Fatalf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err)
}
should be
expected, err := ctrl.expectedCalls.FindMatch(receiver, method, args)
if err != nil {
origin := callerInfo(2)
ctrl.t.Logf("Unexpected call to %T.%v(%v) at %s because: %s", receiver, method, args, origin, err)
}
Metadata
Metadata
Assignees
Labels
No labels