Sha256: 3ad872967474226e57a547462fe70e0fb0b909f390e4fe48874d363ceac58b90

Contents?: true

Size: 641 Bytes

Versions: 15

Compression:

Stored size: 641 Bytes

Contents

module VCRStubHelpers
  def interactions_from(file)
    hashes = YAML.load_file(File.join(VCR::SPEC_ROOT, 'fixtures', file))['http_interactions']
    hashes.map { |h| VCR::HTTPInteraction.from_hash(h) }
  end

  def stub_requests(*args)
    VCR.stub(:http_interactions => VCR::Cassette::HTTPInteractionList.new(*args))
  end

  def http_interaction(url, response_body = "FOO!", status_code = 200)
    request = VCR::Request.new(:get, request_url)
    response_status = VCR::ResponseStatus.new(status_code)
    response = VCR::Response.new(response_status, nil, response_body, '1.1')
    VCR::HTTPInteraction.new(request, response)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vcr-2.5.0 spec/support/vcr_stub_helpers.rb
vcr-2.4.0 spec/support/vcr_stub_helpers.rb
vcr-2.3.0 spec/support/vcr_stub_helpers.rb
vcr-2.2.5 spec/support/vcr_stub_helpers.rb
vcr-2.2.4 spec/support/vcr_stub_helpers.rb
vcr-2.2.3 spec/support/vcr_stub_helpers.rb
vcr-2.2.2 spec/support/vcr_stub_helpers.rb
vcr-2.2.1 spec/support/vcr_stub_helpers.rb
vcr-2.2.0 spec/support/vcr_stub_helpers.rb
vcr-2.1.1 spec/support/vcr_stub_helpers.rb
vcr-2.1.0 spec/support/vcr_stub_helpers.rb
vcr-2.0.1 spec/support/vcr_stub_helpers.rb
vcr-2.0.0 spec/support/vcr_stub_helpers.rb
vcr-2.0.0.rc2 spec/support/vcr_stub_helpers.rb
vcr-2.0.0.rc1 spec/support/vcr_stub_helpers.rb