We are using the Ruby VCR library to mock and replay responses from various APIs.
In one function that we have, our code continuously polls an API endpoint until the response is ready. The VCR Cassette is storing each of these polling requests, with the "Not Ready" response. At the very end of the cassette, the actual response is stored.
How can I configure VCR to store only the last and actual response? I can go into the YML file and manually delete the polling requests, but I would prefer an automated way since I would have to delete these requests on every new cassette recording.
The main reason why I want to delete these polling requests is due to the time it takes to run our tests (we have a lengthy sleep in our code between each unsuccessful poll).
Aucun commentaire:
Enregistrer un commentaire