summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 01:38:59 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-03 01:38:59 +0000
commita84bfcbf0061d30946e4d9692e9d4fa70682aef4 (patch)
tree41b3c94f7648640d256a0619a4ad24318da64931 /test
parent2758be26bb21be9acfd8720bb8160dab2ddc363e (diff)
* lib/net/http.rb: More descriptive error message when net/http fails
to connect to a server. Patch by @xaviershay [fix GH-700] * test/net/http/test_http.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/net/http/test_http.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/net/http/test_http.rb b/test/net/http/test_http.rb
index 9d5cf39..4d82fd7 100644
--- a/test/net/http/test_http.rb
+++ b/test/net/http/test_http.rb
@@ -188,6 +188,15 @@ class TestNetHTTP < Test::Unit::TestCase
end
end
+ def test_failure_message_includes_failed_domain_and_port
+ begin
+ Net::HTTP.get(URI.parse("http://doesnotexist.bogus"))
+ fail "should have raised"
+ rescue => e
+ assert_includes e.message, "doesnotexist.bogus:80"
+ end
+ end
+
end
module TestNetHTTP_version_1_1_methods