1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Adding missing test for Net::HTTPGenericRequest initializer (#1835)

A new exception is raised if an URI::HTTP is received and that object doesn't
have a hostname property.
Complementary to #1278
This commit is contained in:
Espartaco Palma 2019-08-15 16:38:46 +00:00 committed by Takashi Kokubun
parent 2f919a92ba
commit 2665e5858f

View file

@ -75,6 +75,7 @@ class HTTPRequestTest < Test::Unit::TestCase
assert_equal "example.com", req['Host']
assert_raise(ArgumentError){ Net::HTTP::Get.new(URI("urn:ietf:rfc:7231")) }
assert_raise(ArgumentError){ Net::HTTP::Get.new(URI("http://")) }
end
def test_header_set