Sha256: e4db620a1927aa32f2b298a869d796a0eda313f12d4ca3fdf48a138a22b7f76f

Contents?: true

Size: 825 Bytes

Versions: 9

Compression:

Stored size: 825 Bytes

Contents

# frozen_string_literal: true

require 'peddler/vcr_matcher'
require 'yaml'
require 'vcr'

# So we can continue testing against old Content-MD5 header
::Peddler::VCRMatcher.ignored_params << 'ContentMD5Value'

VCR.configure do |c|
  c.hook_into :excon
  c.cassette_library_dir = 'test/vcr_cassettes'

  c.default_cassette_options = {
    match_requests_on: [::Peddler::VCRMatcher],
    record: ENV['RECORD'] ? :new_episodes : :none
  }

  # c.before_record do |interaction|
  #   code = interaction.response.status.code
  #   interaction.ignore! if code >= 400 && code != 414
  # end
end

module Recorder
  def setup
    ENV['LIVE'] ? VCR.turn_off! : VCR.insert_cassette(test_name)
  end

  def teardown
    VCR.eject_cassette if VCR.turned_on?
  end

  private

  def test_name
    self.class.name.sub('Test', '')
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
peddler-2.1.1 test/recorder.rb
peddler-2.1.0 test/recorder.rb
peddler-2.0.4 test/recorder.rb
peddler-2.0.3 test/recorder.rb
peddler-2.0.0 test/recorder.rb
peddler-1.6.7 test/recorder.rb
peddler-1.6.6 test/recorder.rb
peddler-1.6.5 test/recorder.rb
peddler-1.6.4 test/recorder.rb