exvcr
exvcr copied to clipboard
Cassette is not ejected after the test
Right now this happens:
- I have a file with multiple test cases,
- each case is wrapped into with
use_cassette/2macro, - bottom-most test case is called X,
- I add a new test case Y that performs HTTP request, but I forget to wrap it into a
use_cassette/2macro, - I run the tests,
- test case Y fails with a message: "cassette from test case X doesn't contain a response matching a request from Y".
This can be seen in this PR: https://github.com/robconery/stripity-stripe/pull/80 Here's a failing travis build: https://travis-ci.org/robconery/stripity-stripe/builds/153164601
I'm having this issue as well. Got an entire other spec failing because a separate file did not eject.
One solution that seem to work is to add options: [clear_mock: true] at the end of the import
For example
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
becomes
use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney, options: [clear_mock: true]
You have to add it everytime you use ExVCR or some cassette keeps lying around
As I've said, I'm not sure this is the solution, it's just working for me ATM