Module: NxtVcrHarness::VcrCassetteHelper
- Defined in:
- lib/nxt_vcr_harness.rb
Instance Method Summary collapse
- #hash_from_example(example, **options) ⇒ Object
- #with_vcr_cassette(example, **options, &block) ⇒ Object
Instance Method Details
#hash_from_example(example, **options) ⇒ Object
20 21 22 23 24 |
# File 'lib/nxt_vcr_harness.rb', line 20 def hash_from_example(example, **) = %i[prefix suffix] name = CassetteNameByExample.new(example).call(**.slice(*)) Digest::MD5.hexdigest(name) end |
#with_vcr_cassette(example, **options, &block) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/nxt_vcr_harness.rb', line 9 def with_vcr_cassette(example, **, &block) = %i[prefix suffix] cassette_path = CassetteNameByExample.new(example).call(**.slice(*)) = .reject { |k,_| k.in?() } ::VCR.use_cassette(cassette_path, **) do block.call end end |