aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-18 07:32:08 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-18 07:32:08 +0000
commit9381cd1184f8230de4c60b27d3c788107bfa292c (patch)
tree387a45af651497f4d80b832394c7f0e4e2fcb092 /test/uri
parent69305da74d9d6f3c0da668b9a95d872eee27e527 (diff)
downloadruby-9381cd1184f8230de4c60b27d3c788107bfa292c.tar.gz
* lib/uri/generic.rb (URI::Generic.build): duplicate args before adding
new items. (don't change arguments) * lib/uri/generic.rb (URI::Generic.build): use URI::Generic::COMPONENT if this method is called from URI::Generic. * lib/uri/generic.rb (URI::Generic.build2): escape only if the item is a String. * lib/uri/generic.rb (URI::Generic.build2): use DEFAULT_PARSER because it doesn't have parser method. [Bug #6420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-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 e0ab049122..6df7bf0069 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -723,4 +723,13 @@ class URI::TestGeneric < Test::Unit::TestCase
u.hostname = "::1"
assert_equal("http://[::1]/bar", u.to_s)
end
+
+ def test_build
+ URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil])
+ end
+
+ def test_build2
+ URI::Generic.build2(path: "/foo bar/baz")
+ URI::Generic.build2(['http', nil, 'example.com', 80, nil, '/foo bar' , nil, nil, nil])
+ end
end