From a4645e56126cc8807fa66d1078d63447510623cf Mon Sep 17 00:00:00 2001 From: glass Date: Sat, 27 Sep 2014 03:13:22 +0000 Subject: * lib/uri/rfc3986_parser.rb: raise URI::InvalidURIError when uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150] * test/uri/test_parser.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/uri/test_parser.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/uri') diff --git a/test/uri/test_parser.rb b/test/uri/test_parser.rb index adf8a1292c..188b4f858c 100644 --- a/test/uri/test_parser.rb +++ b/test/uri/test_parser.rb @@ -38,4 +38,10 @@ class URI::TestParser < Test::Unit::TestCase assert_equal(['http', nil, 'a', URI::HTTP.default_port, '/%uDCBA', nil, nil], uri_to_ary(u1)) end + + def test_raise_bad_uri_for_integer + assert_raise(URI::InvalidURIError) do + URI.parse(1) + end + end end -- cgit v1.2.3