diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-21 10:53:57 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-21 10:53:57 +0000 |
commit | 1ed4ed43f7c49cd690464a60c7e1ec1c0150688b (patch) | |
tree | 267bb5b5c436cf50120e49188e0c955e3839bfa0 /test/ruby | |
parent | f4ef96e6a292b70947adbeca4e12fb7943718e8e (diff) | |
download | ruby-1ed4ed43f7c49cd690464a60c7e1ec1c0150688b.tar.gz |
Add test for r38529 [Bug #7536]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_require.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 2075e09e4f..4279acdde1 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -584,4 +584,17 @@ class TestRequire < Test::Unit::TestCase def test_require_with_array_shift assert_require_with_shared_array_modified("unshift", "shift") 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 |