before_playback hook
VCR.configure do |c|
c.before_playback(:twitter) { ... } # modify the interactions somehow
end
VCR.use_cassette('cassette_1', :tag => :twitter) { ... }
VCR.use_cassette('cassette_2') { ... }Background ()
---
http_interactions:
- request:
method: get
uri: http://localhost:7777/
body:
encoding: UTF-8
string: ""
headers: {}
response:
status:
code: 200
message: OK
headers:
Content-Type:
- text/html;charset=utf-8
Content-Length:
- "20"
body:
encoding: UTF-8
string: previously recorded response
http_version: "1.1"
recorded_at: Tue, 01 Nov 2011 04:58:44 GMT
recorded_with: VCR 2.0.0Modify played back response
Modify played back response based on the cassette
Prevent playback by ignoring interaction in before_playback hook
Multiple hooks are run in order
Use tagging to apply hooks to only certain cassettes
Last updated