You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test fails, but for the wrong reason. What seems to be happening is that if one strings together multiple once's in the same call then only the last one is remembered. So this test fails because I get an unexpected call on m(23).
Yea, withArgs are not chainable as they do not return a reference to the 'root' of the method, they return a branched path defined with the conditional. So for example you could do
mock.expects('m').once().withArgs(5).withArgs(7)
And I'm PRETTY sure, what you really get is something that needs both a 5 and a 7 as args. Spot check me on that.
But I am certain that do do what you want, gotta declare them separately. Don't know if there's conversations around that, but I've been working with that for some time.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This test fails, but for the wrong reason. What seems to be happening is that if one strings together multiple once's in the same call then only the last one is remembered. So this test fails because I get an unexpected call on m(23).
Just to be complete I also tried:
And it also fails because the m(23) call was unexpected. Again confirming that the last once overwrites the first once.
Personally I found this very surprising. Is this the intended behavior?
The text was updated successfully, but these errors were encountered: