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

Add AssertExpectationsInOrder #1

Merged
merged 1 commit into from Sep 23, 2021
Merged

Add AssertExpectationsInOrder #1

merged 1 commit into from Sep 23, 2021

Conversation

r-insider
Copy link
Owner

This adds a function to assert mock calls in order, resolving stretchr#741. I've
added all the test cases I can think of and tried to design the edge
cases around repeatability and optionality to make sense with the rest
of the package.

My one concern is about the v2 work - I hope this can fit into v1 with
minimal pain on the maintainers side.

AssertExpectationsInOrder asserts that everything specified with On and Return
was in fact called as expected in the order expected. Expectations set up for
a specific number of times must be called that number of times before the next
call to the mock is made. If optional, they do not need to be called the full
number of times. Expectation with no specific limit must be called at least
once unless optional.

Summary

Changes

Motivation

Related issues

This adds a function to assert mock calls in order, resolving stretchr#741. I've
added all the test cases I can think of and tried to design the edge
cases around repeatability and optionality to make sense with the rest
of the package.

My one concern is about the v2 work - I hope this can fit into v1 with
minimal pain on the maintainers side.

> AssertExpectationsInOrder asserts that everything specified with On and Return
was in fact called as expected in the order expected. Expectations set up for
a specific number of times must be called that number of times before the next
call to the mock is made. If optional, they do not need to be called the full
number of times. Expectation with no specific limit must be called at least
once unless optional.
@r-insider r-insider merged commit c00b2e3 into master Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants