Sha256: 5782e47588c464a0b345a3d0597ae0470dabb9ed6bd27dcc7866f8b8fd881e3c

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

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

with_rackup('basic.ru') do
  Shindo.tests('Excon basics') do
    tests('GET /content-length/100') do

      connection = Excon.new('http://127.0.0.1:9292')
      response = connection.request(:method => 'GET', :path => '/content-length/100')

      tests('response.status').returns(200) do
        response.status
      end

      tests("response.headers['Connection']").returns('Keep-Alive') do
        response.headers['Connection']
      end

      tests("response.headers['Content-Length']").returns('100') do
        response.headers['Content-Length']
      end

      tests("response.headers['Content-Type']").returns('text/html;charset=utf-8') do
        response.headers['Content-Type']
      end

      test("Time.parse(response.headers['Date']).is_a?(Time)") do
        Time.parse(response.headers['Date']).is_a?(Time)
      end

      test("!!(response.headers['Server'] =~ /^WEBrick/)") do
        !!(response.headers['Server'] =~ /^WEBrick/)
      end

      tests("response.body").returns('x' * 100) do
        response.body
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
excon-0.5.5 tests/basic_tests.rb
excon-0.5.4 tests/basic_tests.rb
excon-0.5.3 tests/basic_tests.rb
excon-0.5.2 tests/basic_tests.rb
excon-0.5.1 tests/basic_tests.rb
excon-0.5.0 tests/basic_tests.rb