Sha256: 009fe3fb1a5c880058b5a0084bc95585907d3a51206ead2c995f13f84a9a8252

Contents?: true

Size: 1.39 KB

Versions: 10

Compression:

Stored size: 1.39 KB

Contents

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

  with_rackup('response_header.ru') do

    tests('Response#get_header') do
      connection = Excon.new('http://foo.com:8080', :proxy => 'http://localhost: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

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
excon-0.7.6 tests/header_tests.rb
excon-0.7.5 tests/header_tests.rb
excon-0.7.4 tests/header_tests.rb
excon-0.7.3 tests/header_tests.rb
excon-0.7.2 tests/header_tests.rb
excon-0.7.1 tests/header_tests.rb
excon-0.7.0 tests/header_tests.rb
excon-0.6.6 tests/header_tests.rb
excon-0.6.5 tests/header_tests.rb
excon-0.6.4 tests/header_tests.rb