aboutsummaryrefslogtreecommitdiffstats
path: root/test/uri
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 03:18:17 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-23 03:18:17 +0000
commit66aba8cca29d250667ec0830cca77a9b021745cc (patch)
treec8ba61c360416415764c2d09bb571217a302465c /test/uri
parent053759edfc80a51eeea0cfa9c46e4bb57589bf00 (diff)
downloadruby-66aba8cca29d250667ec0830cca77a9b021745cc.tar.gz
suppress warnings of URI.extract
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/uri')
-rw-r--r--test/uri/test_common.rb33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/uri/test_common.rb b/test/uri/test_common.rb
index 1675257d5c..e1fd8bc1c0 100644
--- a/test/uri/test_common.rb
+++ b/test/uri/test_common.rb
@@ -1,5 +1,6 @@
require 'test/unit'
require 'uri'
+require '../ruby/envutil'
module URI
@@ -12,21 +13,23 @@ class TestCommon < Test::Unit::TestCase
end
def test_extract
- assert_equal(['http://example.com'],
- URI.extract('http://example.com'))
- assert_equal(['http://example.com'],
- URI.extract('(http://example.com)'))
- assert_equal(['http://example.com/foo)'],
- URI.extract('(http://example.com/foo)'))
- assert_equal(['http://example.jphttp://example.jp'],
- URI.extract('http://example.jphttp://example.jp'), "[ruby-list:36086]")
- assert_equal(['http://example.jphttp://example.jp'],
- URI.extract('http://example.jphttp://example.jp', ['http']), "[ruby-list:36086]")
- assert_equal(['http://', 'mailto:'].sort,
- URI.extract('ftp:// http:// mailto: https://', ['http', 'mailto']).sort)
- # reported by Doug Kearns <djkea2@mugca.its.monash.edu.au>
- assert_equal(['From:', 'mailto:xxx@xxx.xxx.xxx]'].sort,
- URI.extract('From: XXX [mailto:xxx@xxx.xxx.xxx]').sort)
+ EnvUtil.suppress_warning do
+ assert_equal(['http://example.com'],
+ URI.extract('http://example.com'))
+ assert_equal(['http://example.com'],
+ URI.extract('(http://example.com)'))
+ assert_equal(['http://example.com/foo)'],
+ URI.extract('(http://example.com/foo)'))
+ assert_equal(['http://example.jphttp://example.jp'],
+ URI.extract('http://example.jphttp://example.jp'), "[ruby-list:36086]")
+ assert_equal(['http://example.jphttp://example.jp'],
+ URI.extract('http://example.jphttp://example.jp', ['http']), "[ruby-list:36086]")
+ assert_equal(['http://', 'mailto:'].sort,
+ URI.extract('ftp:// http:// mailto: https://', ['http', 'mailto']).sort)
+ # reported by Doug Kearns <djkea2@mugca.its.monash.edu.au>
+ assert_equal(['From:', 'mailto:xxx@xxx.xxx.xxx]'].sort,
+ URI.extract('From: XXX [mailto:xxx@xxx.xxx.xxx]').sort)
+ end
end
def test_regexp