parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
724 stars 132 forks source link

Feature request: `start_cassette` and `stop_cassette` #185

Open marcandre opened 2 years ago

marcandre commented 2 years ago

The use_cassette function is really nice for use with ExUnit, but having an official start_cassette and stop_cassette would make it possible to use in other usecases.

In particular, we want to use ExVcr in end-to-end tests using Cypress, so we'd like to tell our Phoenix server to start using a cassette, then send a bunch of requests / liveview events, then finally stop using the cassette.

It is currently possible to look at the source and write these, but that could break in the future. A sure fire way is to write a process that can call use_cassette and block until desired.

Would start_cassette and stop_cassette be acceptable new functions?