[前][次][番号順一覧][スレッド一覧]

ruby-changes:34422

From: naruse <ko1@a...>
Date: Mon, 23 Jun 2014 12:18:24 +0900 (JST)
Subject: [ruby-changes:34422] naruse:r46503 (trunk): suppress warnings of URI.extract

naruse	2014-06-23 12:18:17 +0900 (Mon, 23 Jun 2014)

  New Revision: 46503

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46503

  Log:
    suppress warnings of URI.extract

  Modified files:
    trunk/test/uri/test_common.rb
Index: test/uri/test_common.rb
===================================================================
--- test/uri/test_common.rb	(revision 46502)
+++ test/uri/test_common.rb	(revision 46503)
@@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/test/uri/test_common.rb#L1
 require 'test/unit'
 require 'uri'
+require '../ruby/envutil'
 
 module URI
 
@@ -12,21 +13,23 @@ class TestCommon < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/uri/test_common.rb#L13
   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@m...>
-    assert_equal(['From:', 'mailto:xxx@x...]'].sort,
-		 URI.extract('From: XXX [mailto:xxx@x...]').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@m...>
+      assert_equal(['From:', 'mailto:xxx@x...]'].sort,
+                   URI.extract('From: XXX [mailto:xxx@x...]').sort)
+    end
   end
 
   def test_regexp

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]