From 74f6b8e7c9ca570b7663554f7ce2b76f3eb78497 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 5 Jul 2004 14:06:10 +0000 Subject: * lib/uri/common.rb (Kernel#URI): new global method for parsing URIs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/uri/test_common.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/uri') diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb index 1e1a40d115..a159901ea6 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 -- cgit v1.2.3