Sha256: 769f793335c104b2cbef85838411945a7c902c3f24ee760f20bda28805d866c4

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path('../integration', __FILE__)

module Adapters
  class TyphoeusTest < Faraday::TestCase

    def adapter() :typhoeus end

    Integration.apply(self, :Parallel) do
      # inconsistent outcomes ranging from successful response to connection error
      undef :test_proxy_auth_fail if ssl_mode?

      # Typhoeus adapter not supporting Faraday::SSLError
      undef :test_GET_ssl_fails_with_bad_cert if ssl_mode?

      def test_binds_local_socket
        host = '1.2.3.4'
        conn = create_connection :request => { :bind => { :host => host } }
        assert_equal host, conn.options[:bind][:host]
      end

      # Typhoeus::Response doesn't provide an easy way to access the reason phrase,
      # so override the shared test from Common.
      def test_GET_reason_phrase
        response = get('echo')
        assert_nil response.reason_phrase
      end
    end

    def test_custom_adapter_config
      adapter = Faraday::Adapter::Typhoeus.new(nil, { :forbid_reuse => true, :maxredirs => 1 })

      request = adapter.method(:typhoeus_request).call({})

      assert_equal true, request.options[:forbid_reuse]
      assert_equal 1, request.options[:maxredirs]
    end
  end
end

Version data entries

9 entries across 8 versions & 2 rubygems

Version Path
faraday-0.17.6 test/adapters/typhoeus_test.rb
faraday-0.17.5 test/adapters/typhoeus_test.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/faraday-0.17.3/test/adapters/typhoeus_test.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/faraday-0.17.4/test/adapters/typhoeus_test.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/faraday-0.17.3/test/adapters/typhoeus_test.rb
faraday-0.17.4 test/adapters/typhoeus_test.rb
faraday-0.17.3 test/adapters/typhoeus_test.rb
tdiary-5.1.0 vendor/bundle/gems/faraday-0.17.1/test/adapters/typhoeus_test.rb
faraday-0.17.1 test/adapters/typhoeus_test.rb