Prevent a warning: global variable `$VERSION' not initialized
This commit is contained in:
parent
48c3b08672
commit
86f4415fb8
@ -243,6 +243,8 @@ class TestAllRubyQuine < Test::Unit::TestCase
|
|||||||
def test_all_ruby_quine
|
def test_all_ruby_quine
|
||||||
stdout_bak = $stdout
|
stdout_bak = $stdout
|
||||||
$stdout = StringIO.new
|
$stdout = StringIO.new
|
||||||
|
verbose_bak = $VERBOSE
|
||||||
|
$VERBOSE = nil
|
||||||
src = File.read(File.join(__dir__, "../sample/all-ruby-quine.rb"))
|
src = File.read(File.join(__dir__, "../sample/all-ruby-quine.rb"))
|
||||||
|
|
||||||
eval(src)
|
eval(src)
|
||||||
@ -266,5 +268,6 @@ class TestAllRubyQuine < Test::Unit::TestCase
|
|||||||
assert_equal(RUBY_VERSION, out)
|
assert_equal(RUBY_VERSION, out)
|
||||||
ensure
|
ensure
|
||||||
$stdout = stdout_bak
|
$stdout = stdout_bak
|
||||||
|
$VERBOSE = verbose_bak
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user