Sha256: 77906b72867e65b66a07c3e221cc37d08b623614db48f087a66f520ad6650b78

Contents?: true

Size: 1.33 KB

Versions: 20

Compression:

Stored size: 1.33 KB

Contents

Shindo.tests('Excon response header support') do
  env_init

  with_rackup('response_header.ru') do

    tests('Response#get_header') do
      connection = Excon.new('http://foo.com:8080', :proxy => 'http://127.0.0.1:9292')
      response = connection.request(:method => :get, :path => '/foo')

      tests('with variable header capitalization') do

        tests('response.get_header("mixedcase-header")').returns('MixedCase') do
          response.get_header("mixedcase-header")
        end

        tests('response.get_header("uppercase-header")').returns('UPPERCASE') do
          response.get_header("uppercase-header")
        end

        tests('response.get_header("lowercase-header")').returns('lowercase') do
          response.get_header("lowercase-header")
        end

      end

      tests('when provided key capitalization varies') do

        tests('response.get_header("MIXEDCASE-HEADER")').returns('MixedCase') do
          response.get_header("MIXEDCASE-HEADER")
        end

        tests('response.get_header("MiXeDcAsE-hEaDeR")').returns('MixedCase') do
          response.get_header("MiXeDcAsE-hEaDeR")
        end

      end

      tests('when header is unavailable') do

        tests('response.get_header("missing")').returns(nil) do
          response.get_header("missing")
        end

      end

    end

  end

  env_restore
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
excon-0.30.0 tests/header_tests.rb
excon-0.29.0 tests/header_tests.rb
excon-0.28.0 tests/header_tests.rb
excon-0.27.6 tests/header_tests.rb
excon-0.27.5 tests/header_tests.rb
excon-0.27.4 tests/header_tests.rb
excon-0.27.3 tests/header_tests.rb
excon-0.27.2 tests/header_tests.rb
excon-0.27.1 tests/header_tests.rb
excon-0.27.0 tests/header_tests.rb
excon-0.26.0 tests/header_tests.rb
excon-0.25.3 tests/header_tests.rb
excon-0.25.2 tests/header_tests.rb
excon-0.25.1 tests/header_tests.rb
excon-0.25.0 tests/header_tests.rb
excon-0.24.0 tests/header_tests.rb
excon-0.23.0 tests/header_tests.rb
excon-0.22.1 tests/header_tests.rb
excon-0.22.0 tests/header_tests.rb
excon-0.21.0 tests/header_tests.rb