File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,7 @@ def to_s; @message ; end
36
36
end
37
37
38
38
# Raised when a Errno::ECONNREFUSED occurs.
39
- class ConnectionRefusedError < ConnectionError
40
- def initialize ( message )
41
- @message = message
42
- end
43
- def to_s ; @message ; end
44
- end
39
+ class ConnectionRefusedError < Errno ::ECONNREFUSED ; end
45
40
46
41
# 3xx Redirection
47
42
class Redirection < ConnectionError # :nodoc:
Original file line number Diff line number Diff line change @@ -289,6 +289,13 @@ def test_handle_econnrefused
289
289
assert_raise ( ActiveResource ::ConnectionRefusedError ) { @conn . get ( "/people/1.json" ) }
290
290
end
291
291
292
+ def test_handle_econnrefused_with_backwards_compatible_error
293
+ http = Net ::HTTP . new ( "" )
294
+ @conn . expects ( :http ) . returns ( http )
295
+ http . expects ( :get ) . raises ( Errno ::ECONNREFUSED , "Failed to open TCP connection" )
296
+ assert_raise ( Errno ::ECONNREFUSED ) { @conn . get ( "/people/1.json" ) }
297
+ end
298
+
292
299
def test_auth_type_can_be_string
293
300
@conn . auth_type = "digest"
294
301
assert_equal ( :digest , @conn . auth_type )
You can’t perform that action at this time.
0 commit comments