diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 02:34:47 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-19 02:34:47 +0000 |
commit | fd0776f7ea9a534845c89e3d60c60aa6c48e510a (patch) | |
tree | 6cabc4566e95bea8010d1d81e656aa6a56f5a12a /test/uri | |
parent | 0f0e948178d6a38e21fd4cf8d7d41b2e34e95508 (diff) | |
download | ruby-fd0776f7ea9a534845c89e3d60c60aa6c48e510a.tar.gz |
* lib/uri/rfc2396_parser.rb (initialize_pattern):
URI::Generic.build should accept port as a string.
pattern[:PORT] is not defined for long.
by Dave Slutzkin <daveslutzkin@fastmail.fm>
https://github.com/ruby/ruby/pull/804 fix GH-804
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r-- | test/uri/test_generic.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb index 37605d5de5..c0597b91dc 100644 --- a/test/uri/test_generic.rb +++ b/test/uri/test_generic.rb @@ -761,6 +761,10 @@ class URI::TestGeneric < Test::Unit::TestCase u = URI::Generic.build(['http', nil, 'example.com', 80, nil, '/foo', nil, nil, nil]) assert_equal('http://example.com:80/foo', u.to_s) + u = URI::Generic.build(:port => "5432") + assert_equal(":5432", u.to_s) + assert_equal(5432, u.port) + u = URI::Generic.build(:scheme => "http", :host => "::1", :path => "/bar/baz") assert_equal("http://[::1]/bar/baz", u.to_s) assert_equal("[::1]", u.host) |