From e02eb253e7a31f4767eecd8d55a62e5a5608b74a Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 23 Jun 2014 03:18:51 +0000 Subject: * 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 --- test/uri/test_generic.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/uri') 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 = '/') -- cgit v1.2.3