summaryrefslogtreecommitdiff
path: root/test/ruby/test_variable.rb
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 14:42:17 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-12 14:42:17 +0000
commit18e46b81fffb7c675515b151deed0f8b2a3a2c64 (patch)
tree3e42e54ffbf8df5338ccb1ddb90c8ef4fc3372e4 /test/ruby/test_variable.rb
parent9c504ea8111fb44b46e3011c0417045720334f43 (diff)
* vm.c (collect_local_variables_in_env): remove unnecessary check
which causes: x=1;proc{local_variables}.call #=> [] * test/ruby/test_variable.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_variable.rb')
-rw-r--r--test/ruby/test_variable.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb
index 349cb05ae7..601fc21c74 100644
--- a/test/ruby/test_variable.rb
+++ b/test/ruby/test_variable.rb
@@ -59,4 +59,11 @@ class TestVariable < Test::Unit::TestCase
lvar = 1
assert_instance_of(Symbol, local_variables[0], "[ruby-dev:34008]")
end
+
+ def test_local_variables2
+ x = 1
+ proc do |y|
+ assert_equal([:x, :y], local_variables.sort)
+ end.call
+ end
end