File: timeout_tests.rb

package info (click to toggle)
ruby-excon 0.112.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,232 kB
  • sloc: ruby: 7,855; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
Shindo.tests('read should timeout') do
  with_rackup('timeout.ru') do

    [false, true].each do |nonblock|
      tests("nonblock => #{nonblock} hits read_timeout").raises(Excon::Errors::Timeout) do
        connection = Excon.new('http://127.0.0.1:9292', :nonblock => nonblock)
        connection.request(:method => :get, :path => '/timeout', :read_timeout => 1)
      end
    end

  end
end