summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-30 15:57:06 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-30 15:57:06 +0000
commit16310405170cf26f2412622ee7978e8d5a05d61b (patch)
tree52bab2d99bf0b396006e1f285578bcca1c3f9f12 /test
parent6468b9bec07ae06fedfe431efca42fd38877d0c7 (diff)
merge revision(s) 56166: [Backport #12766]
* lib/uri/generic.rb (def check_password): don't include bad password in URI exception output * test/uri/test_generic.rb (def test_set_component): test for behavior git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@56307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/uri/test_generic.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 37605d5de5..a225bc573c 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -741,6 +741,15 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_equal('foo:xyzzy', uri.to_s)
end
+ def test_bad_password_component
+ uri = URI.parse('http://foo:bar@baz')
+ password = 'foo@bar'
+ e = assert_raise(URI::InvalidComponentError) do
+ uri.password = password
+ end
+ refute_match password, e.message
+ end
+
def test_set_scheme
uri = URI.parse 'HTTP://example'