-
Notifications
You must be signed in to change notification settings - Fork 12
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
support looping through responses for the same request? #190
Comments
vcr has something that may address this already, see e.g., in the Ruby vcr docs https://relishapp.com/vcr/vcr/v/5-1-0/docs/request-matching/playback-repeats and we have that arg in this pkg https://docs.ropensci.org/vcr/reference/use_cassette.html - I've not used it yet, so can't be 100% certain it works as intended, so would be good to try |
Oh actually the default behavior is the right one, awesome. See the test of So I'm a bit undecided regarding what to encourage folks to use
Maybe the book should just mention both. webmockr allows more flexibility in how you define a sequence, but it's a new thing to learn after making the effort to understand vcr and cassettes. 🤔 |
of? do you mean the default value for |
Yes, I didn't have to change anything |
I think this can be closed, it works and it's documented in https://docs.ropensci.org/vcr/articles/cassette-manual-editing.html#example-2-test-using-an-edited-cassette-with-a-503-then-a-200-1 |
Context: At the moment for faking some behavior of the server (e.g. an error, or simpler responses to decrease the fixture size) one needs to use webmockr.
This is not ideal as it's quite different from vcr.
One alternative is
It's quite handy IMHO.
Now, one thing that this workflow can't handle is testing retries. So I wonder whether there'd be a way to add a field "count" to the fixture and e.g. have
and vcr would loop through the responses?
The text was updated successfully, but these errors were encountered: