Sha256: 19c0b88aee2ac1a86d6fd4a32e0b5fc2b974214ab1bfd1f5556976a4007c0f25

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'helper'))

if Faraday::Adapter::Typhoeus.loaded?
  module Adapters
    class TestTyphoeus < Faraday::TestCase
      def setup
        @adapter = Faraday::Adapter::Typhoeus.new
      end

      def test_parse_response_headers_leaves_http_status_line_out
        headers = @adapter.parse_response_headers("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n")
        assert_equal %w(content-type), headers.keys
      end

      def test_parse_response_headers_parses_lower_cased_header_name_and_value
        headers = @adapter.parse_response_headers("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n")
        assert_equal 'text/html', headers['content-type']
      end

      def test_parse_response_headers_parses_lower_cased_header_name_and_value_with_colon
        headers = @adapter.parse_response_headers("HTTP/1.1 200 OK\r\nContent-Type: text/html\r\nLocation: http://sushi.com/\r\n\r\n")
        assert_equal 'http://sushi.com/', headers['location']
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
faraday-0.5.0 test/adapters/typhoeus_test.rb
shin-faraday-0.4.7 test/adapters/typhoeus_test.rb
faraday-0.4.6 test/adapters/typhoeus_test.rb
faraday-0.4.5 test/adapters/typhoeus_test.rb
faraday-0.4.4 test/adapters/typhoeus_test.rb
faraday-0.4.3 test/adapters/typhoeus_test.rb
faraday-0.4.2 test/adapters/typhoeus_test.rb
faraday-0.4.1 test/adapters/typhoeus_test.rb
faraday-0.4.0 test/adapters/typhoeus_test.rb
faraday-0.3.1 test/adapters/typhoeus_test.rb
faraday-0.3.0 test/adapters/typhoeus_test.rb
faraday-0.2.4 test/adapters/typhoeus_test.rb