summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_http_request.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/net/http/test_http_request.rb b/test/net/http/test_http_request.rb
index c2144d86c7..b7515b7e98 100644
--- a/test/net/http/test_http_request.rb
+++ b/test/net/http/test_http_request.rb
@@ -65,6 +65,18 @@ class HTTPRequestTest < Test::Unit::TestCase
'Bug #7381 - do not decode content if the user overrides'
end if Net::HTTP::HAVE_ZLIB
+ def test_initialize_GET_uri
+ req = Net::HTTP::Get.new(URI("http://example.com/foo"))
+ assert_equal "/foo", req.path
+ assert_equal "example.com", req['Host']
+
+ req = Net::HTTP::Get.new(URI("https://example.com/foo"))
+ assert_equal "/foo", req.path
+ assert_equal "example.com", req['Host']
+
+ assert_raise(ArgumentError){ Net::HTTP::Get.new(URI("urn:ietf:rfc:7231")) }
+ end
+
def test_header_set
req = Net::HTTP::Get.new '/'