mirror of
https://github.com/lostisland/faraday.git
synced 2025-08-10 00:03:15 -04:00
work around the fact that timeout is different on my Mac than on Travis
This commit is contained in:
parent
2d290f63da
commit
ec6ef38713
@ -17,8 +17,16 @@ module Adapters
|
||||
# not using shared test because error is swallowed by Sinatra
|
||||
def test_timeout
|
||||
conn = create_connection(:request => {:timeout => 1, :open_timeout => 1})
|
||||
err = assert_raise(Faraday::Error::ClientError) { conn.get '/slow' }
|
||||
assert_include err.response[:body], 'execution expired'
|
||||
err = assert_raise { conn.get '/slow' }
|
||||
|
||||
case err
|
||||
when Faraday::Error::ClientError
|
||||
# happens on Mac OS
|
||||
assert_include err.response[:body], 'execution expired'
|
||||
else
|
||||
# happens on Travis
|
||||
assert_instance_of Timeout::Error, err
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user