diff options
Diffstat (limited to 'activeresource/test/connection_test.rb')
-rw-r--r-- | activeresource/test/connection_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activeresource/test/connection_test.rb b/activeresource/test/connection_test.rb index 60a8204533..12e8058b0c 100644 --- a/activeresource/test/connection_test.rb +++ b/activeresource/test/connection_test.rb @@ -185,6 +185,17 @@ class ConnectionTest < Test::Unit::TestCase assert_raise(ActiveResource::TimeoutError) { @conn.get('/people_timeout.xml') } end + def test_setting_timeout + http = Net::HTTP.new('') + + [10, 20].each do |timeout| + @conn.timeout = timeout + @conn.send(:configure_http, http) + assert_equal timeout, http.open_timeout + assert_equal timeout, http.read_timeout + end + end + def test_accept_http_header @http = mock('new Net::HTTP') @conn.expects(:http).returns(@http) |