aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_trick.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2023-08-09 15:35:16 +0900
committerYusuke Endoh <mame@ruby-lang.org>2023-08-09 15:35:16 +0900
commit86f4415fb8e1da61eb9e844c68e41e30393eeac7 (patch)
treec760b40ce702ef052cbc1c72e2a5528f479ba6c7 /test/test_trick.rb
parent48c3b0867221c79c0a079a006ae628318c4cb3a7 (diff)
downloadruby-86f4415fb8e1da61eb9e844c68e41e30393eeac7.tar.gz
Prevent a warning: global variable `$VERSION' not initialized
Diffstat (limited to 'test/test_trick.rb')
-rw-r--r--test/test_trick.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_trick.rb b/test/test_trick.rb
index ddedb6e527..878d79e628 100644
--- a/test/test_trick.rb
+++ b/test/test_trick.rb
@@ -243,6 +243,8 @@ class TestAllRubyQuine < Test::Unit::TestCase
def test_all_ruby_quine
stdout_bak = $stdout
$stdout = StringIO.new
+ verbose_bak = $VERBOSE
+ $VERBOSE = nil
src = File.read(File.join(__dir__, "../sample/all-ruby-quine.rb"))
eval(src)
@@ -266,5 +268,6 @@ class TestAllRubyQuine < Test::Unit::TestCase
assert_equal(RUBY_VERSION, out)
ensure
$stdout = stdout_bak
+ $VERBOSE = verbose_bak
end
end