Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

retain ordering of expected calls #107

Merged
merged 1 commit into from
Sep 15, 2017
Merged

retain ordering of expected calls #107

merged 1 commit into from
Sep 15, 2017

Conversation

natebrennand
Copy link

While writing tests for a stateful object, I noticed unexpected behavior
where the mock would use the 1st call, but then the 3rd expected call
before the 2nd (called in [1,3,2]).

Since our tests all used the gomock.Any() function param, there was no
ordering that could be detected by the matching without chaining all
calls with After().

While writing tests for a stateful object, I noticed unexpected behavior
where the mock would use the 1st call, but then the 3rd expected call
before the 2nd ([1,3,2]).

Since our tests all used the `gomock.Any()` function param, there was no
ordering that could be detected by the matching without chaining all
calls with `After()`.
@balshetzer balshetzer merged commit cd1f5ca into golang:master Sep 15, 2017
@balshetzer
Copy link
Collaborator

@natebrennand It occurred to me after merging this that I should have asked for a unit test for this. I don't have any more leverage but I would appreciate it if you would write one.

@natebrennand natebrennand deleted the retain-expected-call-order branch September 15, 2017 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants