From 86f4415fb8e1da61eb9e844c68e41e30393eeac7 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Wed, 9 Aug 2023 15:35:16 +0900 Subject: [PATCH] Prevent a warning: global variable `$VERSION' not initialized --- test/test_trick.rb | 3 +++ 1 file changed, 3 insertions(+) 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