summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-23 06:08:29 +0000
committerakira <akira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-23 06:08:29 +0000
commit616a75e7e3db6a6c343f292e19d5afd531a2dc00 (patch)
tree8d47afc558ca6b160bba83fbe5a74077e5a9e71e /test
parentd805a0d0766c7422e25886ee6282d85eaff26b5b (diff)
* lib/uri/generic.rb (split_userinfo): should split ":pass" into ""
and "pass". [ruby-dev:25667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/uri/test_generic.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/uri/test_generic.rb b/test/uri/test_generic.rb
index 8740574..8a7feb4 100644
--- a/test/uri/test_generic.rb
+++ b/test/uri/test_generic.rb
@@ -117,11 +117,26 @@ class TestGeneric < Test::Unit::TestCase
assert_raises(URI::InvalidURIError) { URI.parse('http://a_b/') }
# 8
- # reporte by m_seki
+ # reported by m_seki
uri = URI.parse('file:///foo/bar.txt')
assert_kind_of(URI::Generic, url)
uri = URI.parse('file:/foo/bar.txt')
assert_kind_of(URI::Generic, url)
+
+ # 9
+ # [ruby-dev:25667]
+ url = URI.parse('ftp://:pass@localhost/')
+ assert_equal('', url.user)
+ assert_equal('pass', url.password)
+ assert_equal(':pass', url.userinfo)
+ url = URI.parse('ftp://user@localhost/')
+ assert_equal('user', url.user)
+ assert_equal(nil, url.password)
+ assert_equal('user', url.userinfo)
+ url = URI.parse('ftp://localhost/')
+ assert_equal(nil, url.user)
+ assert_equal(nil, url.password)
+ assert_equal(nil, url.userinfo)
end
def test_merge