aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 03:18:51 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 03:18:51 +0000
commite02eb253e7a31f4767eecd8d55a62e5a5608b74a (patch)
treed0402911b04cf1515a5eefab193c12e14be67bbd /test/uri
parent66aba8cca29d250667ec0830cca77a9b021745cc (diff)
downloadruby-e02eb253e7a31f4767eecd8d55a62e5a5608b74a.tar.gz
* lib/uri/generic.rb (check_port): allow strings for port= as
described in rdoc. * lib/uri/rfc3986_parser.rb (regexp): implementation detail of above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_generic.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 398c4cc830..977ae72250 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -697,6 +697,14 @@ class URI::TestGeneric < Test::Unit::TestCase
assert_equal('http://foo:bar@baz', uri.to_s)
assert_equal('zab', uri.host = 'zab')
assert_equal('http://foo:bar@zab', uri.to_s)
+ uri.port = ""
+ assert_nil(uri.port)
+ uri.port = "80"
+ assert_equal(80, uri.port)
+ uri.port = "080"
+ assert_equal(80, uri.port)
+ uri.port = " 080 "
+ assert_equal(80, uri.port)
assert_equal(8080, uri.port = 8080)
assert_equal('http://foo:bar@zab:8080', uri.to_s)
assert_equal('/', uri.path = '/')