Skip to content

Commit

Permalink
Prevent a warning: global variable `$VERSION' not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Aug 9, 2023
1 parent 48c3b08 commit 86f4415
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/test_trick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -266,5 +268,6 @@ def test_all_ruby_quine
assert_equal(RUBY_VERSION, out)
ensure
$stdout = stdout_bak
$VERBOSE = verbose_bak
end
end

0 comments on commit 86f4415

Please sign in to comment.