module NxtVcrHarness::VcrCassetteHelper
Public Instance Methods
hash_from_example(example, **options)
click to toggle source
# File lib/nxt_vcr_harness.rb, line 19 def hash_from_example(example, **options) cassette_by_example_options = %i[prefix suffix] name = CassetteNameByExample.new(example).call(**options.slice(*cassette_by_example_options)) Digest::MD5.hexdigest(name) end
with_vcr_cassette(example, **options, &block)
click to toggle source
# File lib/nxt_vcr_harness.rb, line 8 def with_vcr_cassette(example, **options, &block) cassette_by_example_options = %i[prefix suffix] cassette_path = CassetteNameByExample.new(example).call(**options.slice(*cassette_by_example_options)) vcr_options = options.reject { |k,_| k.in?(cassette_by_example_options) } ::VCR.use_cassette(cassette_path, **vcr_options) do block.call end end