class VCR::Configuration
def define_cassette_placeholder(placeholder, tag = nil, &block)
- Yieldreturn: - the string to replace
Other tags:
- Yieldparam: interaction - the HTTP interaction
Other tags:
- Yield: - block that determines what string to replace
Parameters:
-
tag
(Symbol
) -- Set this to apply this only to cassettes -
placeholder
(String
) -- The placeholder string.
def define_cassette_placeholder(placeholder, tag = nil, &block) before_record(tag) do |interaction| orig_text = call_block(block, interaction) log "before_record: replacing #{orig_text.inspect} with #{placeholder.inspect}" interaction.filter!(orig_text, placeholder) end before_playback(tag) do |interaction| orig_text = call_block(block, interaction) log "before_playback: replacing #{orig_text.inspect} with #{placeholder.inspect}" interaction.filter!(placeholder, orig_text) end end