Sha256: 84b64008e87f924373eec2861c66ed8ddf68a7053e98550436b76b53ddc34a6b

Contents?: true

Size: 1.1 KB

Versions: 98

Compression:

Stored size: 1.1 KB

Contents

Shindo.tests('Excon bad server interaction') do

  with_server('bad') do

    tests('bad server: causes EOFError') do

      tests('with no content length and no chunking') do
        tests('without a block') do
          tests('response.body').returns('hello') do
            connection = Excon.new('http://127.0.0.1:9292')

            connection.request(:method => :get, :path => '/eof/no_content_length_and_no_chunking').body
          end
        end

        tests('with a block') do
          tests('body from chunks').returns('hello') do
            connection = Excon.new('http://127.0.0.1:9292')

            body = ""
            response_block = lambda {|chunk, remaining, total| body << chunk }

            connection.request(:method => :get, :path => '/eof/no_content_length_and_no_chunking', :response_block => response_block)

            body
          end
        end

      end

    end

  end

  with_server('eof') do

    tests('eof server: causes EOFError') do

      tests('request').raises(Excon::Errors::SocketError) do
        Excon.get('http://127.0.0.1:9292/eof')
      end

    end

  end

end

Version data entries

98 entries across 96 versions & 5 rubygems

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