Sha256: 34e2bf1d92fcdffd0233891ea13228adfc251874123af40e6a6f59a7f85e79f3

Contents?: true

Size: 1.02 KB

Versions: 28

Compression:

Stored size: 1.02 KB

Contents

Shindo.tests('Excon Response Validation') do
  env_init

  with_server('good') do
    tests('good responses with complete headers') do
        100.times do
          res = Excon.get('http://127.0.0.1:9292/chunked/simple')
          returns(true) { res.body == "hello world" }
          returns(true) { res.status_line ==  "HTTP/1.1 200 OK\r\n" }
          returns(true) { res.status == 200}
          returns(true) { res.reason_phrase == "OK" }
          returns(true) { res.remote_ip == "127.0.0.1" }
      end
    end
  end
 
  with_server('error') do
    tests('error responses with complete headers') do
        100.times do
          res = Excon.get('http://127.0.0.1:9292/error/not_found')
          returns(true) { res.body == "server says not found" }
          returns(true) { res.status_line ==  "HTTP/1.1 404 Not Found\r\n" }
          returns(true) { res.status == 404}
          returns(true) { res.reason_phrase == "Not Found" }
          returns(true) { res.remote_ip == "127.0.0.1" }
      end
    end
  end
  
  env_restore
end

Version data entries

28 entries across 26 versions & 4 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/excon-0.62.0/tests/complete_responses.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/excon-0.62.0/tests/complete_responses.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/excon-0.62.0/tests/complete_responses.rb
excon-0.62.0 tests/complete_responses.rb
excon-0.61.0 tests/complete_responses.rb
excon-0.60.0 tests/complete_responses.rb
excon-0.59.0 tests/complete_responses.rb
excon-0.58.0 tests/complete_responses.rb
excon-0.57.1 tests/complete_responses.rb
excon-0.57.0 tests/complete_responses.rb
excon-0.56.0 tests/complete_responses.rb
excon-0.55.0 tests/complete_responses.rb
excon-0.54.0 tests/complete_responses.rb
excon-0.53.0 tests/complete_responses.rb
excon-0.52.0 tests/complete_responses.rb
excon-0.51.0 tests/complete_responses.rb
excon-0.50.1 tests/complete_responses.rb
excon-0.50.0 tests/complete_responses.rb
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/excon-0.45.4/tests/complete_responses.rb
excon-0.49.0 tests/complete_responses.rb