Turn VCR off for rspec example or group
I often use VCR gem.
And I always configure it to use rspec metadata to turn it on with just :vcr
symbol.
When I know that some module will always hit the external service,
I turn VCR on at the very top describe
.
And when I add a new example, I want all requests to be live, until I get my test pass.
I can run any code without VCR in VCR.turned_off do ... end
block. I must eject the loaded cassette before with VCR.eject_cassette
(there must be a reason why it can’t be done automatically).
And finally since I’m using webmock (by default), I have to ask it to let me do real requests with WebMock.allow_net_connect!
I think it’s not fair when turning something on is easy, but turning it off isn’t.
I would write
Here’s my VCR setup files (which usually goes to spec/support
directory)