Sha256: eda72b60cbc231d27d8c3ebb47be03ceff2c604a8f5a456272c7ac9a4b0c0145

Contents?: true

Size: 1.25 KB

Versions: 67

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe "Typhoeus 0.4 hook", :with_monkey_patches => :typhoeus_0_4 do
  after(:each) do
    ::Typhoeus::Hydra.clear_stubs
  end

  def disable_real_connections
    ::Typhoeus::Hydra.allow_net_connect = false
    ::Typhoeus::Hydra::NetConnectNotAllowedError
  end

  def enable_real_connections
    ::Typhoeus::Hydra.allow_net_connect = true
  end

  def directly_stub_request(method, url, response_body)
    response = ::Typhoeus::Response.new(:code => 200, :body => response_body)
    ::Typhoeus::Hydra.stub(method, url).and_return(response)
  end

  it_behaves_like 'a hook into an HTTP library', :typhoeus, 'typhoeus 0.4'

  describe "VCR.configuration.after_library_hooks_loaded hook" do
    it 'disables the webmock typhoeus adapter so it does not conflict with our typhoeus hook' do
      expect(::WebMock::HttpLibAdapters::TyphoeusAdapter).to receive(:disable!)
      $typhoeus_after_loaded_hook.conditionally_invoke
    end

    it "warns about Typhoeus 0.4 deprecation" do
      expect(::Kernel).to receive(:warn).with("WARNING: VCR's Typhoeus 0.4 integration is deprecated and will be removed in VCR 3.0.")
      $typhoeus_0_4_after_loaded_hook.conditionally_invoke
    end
  end
end if RUBY_INTERPRETER == :mri && ::Typhoeus::VERSION.to_f < 0.5

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/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.15 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.14 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.13 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.12 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.11 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.10 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.9 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.8 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.7 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.6 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.5 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.4 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.2 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.1 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-2.0.0 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-1.142.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-1.120.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb
cloudsmith-api-1.61.3 vendor/bundle/ruby/2.6.0/gems/vcr-3.0.3/spec/lib/vcr/library_hooks/typhoeus_0.4_spec.rb