diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-05 14:06:10 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-05 14:06:10 +0000 |
commit | c9e950b2396427eab7859b0ddd8415e43f86e739 (patch) | |
tree | b163552044e56809cc6293571bf02447775c1b32 /test/uri | |
parent | 856c6f1b7e068220800e9d5d502beb6e41e00a19 (diff) | |
download | ruby-c9e950b2396427eab7859b0ddd8415e43f86e739.tar.gz ruby-c9e950b2396427eab7859b0ddd8415e43f86e739.tar.xz ruby-c9e950b2396427eab7859b0ddd8415e43f86e739.zip |
* lib/uri/common.rb (Kernel#URI): new global method for parsing URIs.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r-- | test/uri/test_common.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index 1e1a40d11..a159901ea 100644 --- a/test/uri/test_common.rb +++ b/test/uri/test_common.rb @@ -43,6 +43,13 @@ class TestCommon < Test::Unit::TestCase assert_equal nil, ':'.slice(URI.regexp) assert_equal 'From:', 'From:'.slice(URI.regexp) end + + def test_kernel_uri + expected = URI.parse("http://www.ruby-lang.org/") + assert_equal(expected, URI("http://www.ruby-lang.org/")) + assert_equal(expected, Kernel::URI("http://www.ruby-lang.org/")) + assert_raise(NoMethodError) { Object.new.URI("http://www.ruby-lang.org/") } + end end |