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

ruby-changes:34230

From: akr <ko1@a...>
Date: Mon, 2 Jun 2014 09:56:41 +0900 (JST)
Subject: [ruby-changes:34230] akr:r46310 (trunk): * test/ruby/envutil.rb (default_warning): New method.

akr	2014-06-02 07:31:30 +0900 (Mon, 02 Jun 2014)

  New Revision: 46310

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

  Log:
    * test/ruby/envutil.rb (default_warning): New method.
    
    * test/ruby/test_autoload.rb: Use EnvUtil.default_warning.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/envutil.rb
    trunk/test/ruby/test_autoload.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46309)
+++ ChangeLog	(revision 46310)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jun  2 07:30:33 2014  Tanaka Akira  <akr@f...>
+
+	* test/ruby/envutil.rb (default_warning): New method.
+
+	* test/ruby/test_autoload.rb: Use EnvUtil.default_warning.
+
 Mon Jun  2 07:05:59 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* include/ruby/encoding.h: constify `rb_encoding` arguments.
Index: test/ruby/test_autoload.rb
===================================================================
--- test/ruby/test_autoload.rb	(revision 46309)
+++ test/ruby/test_autoload.rb	(revision 46310)
@@ -74,7 +74,7 @@ p Foo::Bar https://github.com/ruby/ruby/blob/trunk/test/ruby/test_autoload.rb#L74
 
   def test_threaded_accessing_constant
     # Suppress "warning: loading in progress, circular require considered harmful"
-    EnvUtil.suppress_warning {
+    EnvUtil.default_warning {
       Tempfile.create(['autoload', '.rb']) {|file|
         file.puts 'sleep 0.5; class AutoloadTest; X = 1; end'
         file.close
@@ -94,7 +94,7 @@ p Foo::Bar https://github.com/ruby/ruby/blob/trunk/test/ruby/test_autoload.rb#L94
 
   def test_threaded_accessing_inner_constant
     # Suppress "warning: loading in progress, circular require considered harmful"
-    EnvUtil.suppress_warning {
+    EnvUtil.default_warning {
       Tempfile.create(['autoload', '.rb']) {|file|
         file.puts 'class AutoloadTest; sleep 0.5; X = 1; end'
         file.close
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb	(revision 46309)
+++ test/ruby/envutil.rb	(revision 46310)
@@ -122,6 +122,14 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/test/ruby/envutil.rb#L122
   end
   module_function :verbose_warning
 
+  def default_warning
+    verbose, $VERBOSE = $VERBOSE, false
+    yield
+  ensure
+    $VERBOSE = verbose
+  end
+  module_function :default_warning
+
   def suppress_warning
     verbose, $VERBOSE = $VERBOSE, nil
     yield

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

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