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

When searches for a matching call, return most recently expected call. #196

Closed
wants to merge 1 commit into from

Conversation

tocrafty
Copy link

Most recently added action will run after function is called. When this action is exhausted, old action will be triggered

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@tocrafty
Copy link
Author

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

1 similar comment
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link

CLAs look good, thanks!

@balshetzer
Copy link
Collaborator

Could you please explain why it's better to use the latest action rather than the order in which they were added?

@tocrafty
Copy link
Author

tocrafty commented Aug 6, 2018

Sometimes, we need to set up default mock behaviors before test suite. In a test case, we can set up new actions for interface if we want to simulate some erros. After this actions is exhausted, mock behavior will fall back to default setup. With old strategy, all actions must be add as planed and carefully, And they can not be changed after setup. This would be very inflexible.

@poy
Copy link
Collaborator

poy commented Sep 27, 2019

If I'm understanding correctly, this is an attempt to add support for loose mocks in a way. Is that correct?

If so, I've been pointing people towards #246 for a discussion there.

@poy poy self-assigned this Sep 27, 2019
@tocrafty
Copy link
Author

tocrafty commented Oct 7, 2019

Yeah, you are right. I have read read #238 and #246 , and this PR should be redirected to #238 as an mock options for backward compatibility. I will close this one.

@tocrafty tocrafty closed this Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants