Drop Unused Requests
If set to true, this cassette option will cause VCR to drop any unused requests from the cassette when a cassette is ejected. This is useful for reducing the size of cassettes that contain a large number of requests that are not used.
The option defaults to false (mostly for backwards compatibility).
Background
Given a file named "vcr_config.rb" with:
And a previously recorded cassette file "cassettes/example.yml" with:
Unused requests are not dropped from the cassette by default
Given a file named "not_dropped_by_default.rb" with:
When I run ruby not_dropped_by_default.rb
Then the file "cassettes/example.yml" should contain "New Response"
And the file "cassettes/example.yml" should contain "Existing Response".
Unused requests are dropped from the cassette when the option is set
Given a file named "drop_unused_requests_set.rb" with:
When I run ruby drop_unused_requests_set.rb
Then the file "cassettes/example.yml" should contain "New Response"
But the file "cassettes/example.yml" should not contain "Existing Response".
Last updated