Sha256: ae5c6f1f4eba7aad7a4ced7ebe4aa922cf161b0b6ccd2400db2f33c6295af85f

Contents?: true

Size: 663 Bytes

Versions: 67

Compression:

Stored size: 663 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)
    allow(VCR).to receive(:http_interactions).and_return(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

67 entries across 67 versions & 9 rubygems

Version Path
cloudsmith-api-2.0.16 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-1.120.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb
cloudsmith-api-1.61.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/support/vcr_stub_helpers.rb