File: timeout_tests.rb

package info (click to toggle)
ruby-excon 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,240 kB
  • sloc: ruby: 7,970; makefile: 5
file content (12 lines) | stat: -rw-r--r-- 392 bytes parent folder | download | duplicates (7)
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