Sha256: 91d7b47a9eedd9deea4371d770a6a46cc1ba4c9b02d3a7a51431231344f2c600

Contents?: true

Size: 1023 Bytes

Versions: 9

Compression:

Stored size: 1023 Bytes

Contents

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

module Adapters
  class RackTest < Faraday::TestCase

    def adapter() :rack end

    def adapter_options
      [Faraday::LiveServer]
    end

    # no Integration.apply because this doesn't require a server as a separate process
    include Integration::Common
    include Integration::NonParallel

    # Rack::MockResponse doesn't provide any 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

    # not using shared test because error is swallowed by Sinatra
    def test_timeout
      conn = create_connection(:request => {:timeout => 1, :open_timeout => 1})
      begin
        conn.get '/slow'
      rescue Faraday::TimeoutError
      end
    end

    # test not applicable
    undef test_connection_error
    undef test_proxy
    undef test_proxy_auth_fail
  end
end

Version data entries

9 entries across 8 versions & 2 rubygems

Version Path
faraday-0.17.6 test/adapters/rack_test.rb
faraday-0.17.5 test/adapters/rack_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/rack_test.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/faraday-0.17.4/test/adapters/rack_test.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/faraday-0.17.3/test/adapters/rack_test.rb
faraday-0.17.4 test/adapters/rack_test.rb
faraday-0.17.3 test/adapters/rack_test.rb
tdiary-5.1.0 vendor/bundle/gems/faraday-0.17.1/test/adapters/rack_test.rb
faraday-0.17.1 test/adapters/rack_test.rb