diff options
Diffstat (limited to 'activeresource/test/connection_test.rb')
-rw-r--r-- | activeresource/test/connection_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activeresource/test/connection_test.rb b/activeresource/test/connection_test.rb index 6c907614e7..8e43e451ff 100644 --- a/activeresource/test/connection_test.rb +++ b/activeresource/test/connection_test.rb @@ -168,6 +168,15 @@ class ConnectionTest < Test::Unit::TestCase assert_equal 200, response.code end + uses_mocha('test_timeout') do + def test_timeout + @http = mock('new Net::HTTP') + @conn.expects(:http).returns(@http) + @http.expects(:get).raises(Timeout::Error, 'execution expired') + assert_raises(ActiveResource::TimeoutError) { @conn.get('/people_timeout.xml') } + end + end + protected def assert_response_raises(klass, code) assert_raise(klass, "Expected response code #{code} to raise #{klass}") do |