Add test for r38529 [Bug #7536]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f4ef96e6a2
commit
1ed4ed43f7
@ -584,4 +584,17 @@ class TestRequire < Test::Unit::TestCase
|
|||||||
def test_require_with_array_shift
|
def test_require_with_array_shift
|
||||||
assert_require_with_shared_array_modified("unshift", "shift")
|
assert_require_with_shared_array_modified("unshift", "shift")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_require_local_var_on_toplevel
|
||||||
|
bug7536 = '[ruby-core:50701]'
|
||||||
|
Dir.mktmpdir {|tmp|
|
||||||
|
Dir.chdir(tmp) {
|
||||||
|
open("bar.rb", "w") {|f| f.puts 'TOPLEVEL_BINDING.eval("lib = 2")' }
|
||||||
|
assert_in_out_err(%w[-r./bar.rb], <<-INPUT, %w([:lib] 2), [], bug7536)
|
||||||
|
puts TOPLEVEL_BINDING.eval("local_variables").inspect
|
||||||
|
puts TOPLEVEL_BINDING.eval("lib").inspect
|
||||||
|
INPUT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user