mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/envutil.rb (default_warning): New method.
* test/ruby/test_autoload.rb: Use EnvUtil.default_warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
046831094b
commit
fe38158f9b
3 changed files with 16 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Jun 2 07:30:33 2014 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* 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@ruby-lang.org>
|
||||
|
||||
* include/ruby/encoding.h: constify `rb_encoding` arguments.
|
||||
|
|
|
@ -122,6 +122,14 @@ module EnvUtil
|
|||
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
|
||||
|
|
|
@ -74,7 +74,7 @@ p Foo::Bar
|
|||
|
||||
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
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue