What I'm about to suggest won't work for every possible setup (for instance, those wrapping each connection in VCR.use_cassette
, or those using VCR middleware with Faraday). But if you happened to set up VCR using configure_rspec_metadata!
, like so:
https://www.relishapp.com/vcr/vcr/v/3-0-1/docs/test-frameworks/usage-with-rspec-metadata
...in other words, if every example or example group requiring VCR has :vcr
or vcr: true
as metadata, then you can run just the VCR-tagged specs on the command line using, for example:
$ rspec ./spec --tag @vcr
The --tag
option is documented here.
If you're not using the metadata setup, and there's nothing preventing you from using it, switching to it will likely be faster than coming up with some other way to filter the specs, assuming they're thoroughly mixed in there. It's also makes it more convenient to add new VCR specs. One possible downside is that the cassette names might need to change, but since you're planning to re-record them, that shouldn't matter much.