summaryrefslogtreecommitdiff
path: root/test/uri/test_common.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 06:25:44 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-27 06:25:44 +0000
commit36a043a93a4969562b65d6ac4b885bc45be0f8f0 (patch)
treec860548a3a9065d9c9f6c3e744c6bf4b5572e1a9 /test/uri/test_common.rb
parentb0bc5635504faa851742ec056a9875fadf2fdcbc (diff)
suppress warnings: URI.regexp is obsolete
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri/test_common.rb')
-rw-r--r--test/uri/test_common.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index 0e2a8b1959..7808bcdc3c 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -33,17 +33,19 @@ class TestCommon < Test::Unit::TestCase
end
def test_regexp
- assert_instance_of Regexp, URI.regexp
- assert_instance_of Regexp, URI.regexp(['http'])
- assert_equal URI.regexp, URI.regexp
- assert_equal 'http://', 'x http:// x'.slice(URI.regexp)
- assert_equal 'http://', 'x http:// x'.slice(URI.regexp(['http']))
- assert_equal 'http://', 'x http:// x ftp://'.slice(URI.regexp(['http']))
- assert_equal nil, 'http://'.slice(URI.regexp([]))
- assert_equal nil, ''.slice(URI.regexp)
- assert_equal nil, 'xxxx'.slice(URI.regexp)
- assert_equal nil, ':'.slice(URI.regexp)
- assert_equal 'From:', 'From:'.slice(URI.regexp)
+ EnvUtil.suppress_warning do
+ assert_instance_of Regexp, URI.regexp
+ assert_instance_of Regexp, URI.regexp(['http'])
+ assert_equal URI.regexp, URI.regexp
+ assert_equal 'http://', 'x http:// x'.slice(URI.regexp)
+ assert_equal 'http://', 'x http:// x'.slice(URI.regexp(['http']))
+ assert_equal 'http://', 'x http:// x ftp://'.slice(URI.regexp(['http']))
+ assert_equal nil, 'http://'.slice(URI.regexp([]))
+ assert_equal nil, ''.slice(URI.regexp)
+ assert_equal nil, 'xxxx'.slice(URI.regexp)
+ assert_equal nil, ':'.slice(URI.regexp)
+ assert_equal 'From:', 'From:'.slice(URI.regexp)
+ end
end
def test_kernel_uri