summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 16:03:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-24 16:03:12 +0000
commita11831a9a559c296617559f664bcba0aab254563 (patch)
tree9867a689d68d7cc4befbc7b33e1be16e9529ffe9 /test
parent2e6ffdf9577f2bb6513f2909e9c270d6c9dcd6c0 (diff)
proc.c: Binding#local_variables
* proc.c (bind_local_variables): allowing binding to list its local variables. patch by Jack Danger Canty <jackdanger AT squareup.com> at [ruby-core:56543]. [Feature #8773] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_variable.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb
index 32b3d61573..321cd7e4c5 100644
--- a/test/ruby/test_variable.rb
+++ b/test/ruby/test_variable.rb
@@ -83,6 +83,17 @@ class TestVariable < Test::Unit::TestCase
end.call
end
+ def local_variables_of(bind)
+ this_should_not_be_in_bind = 2
+ bind.local_variables
+ end
+
+ def test_local_variables_from_other_method_binding
+ feature8773 = '[Feature #8773]'
+ x = 1
+ assert_equal([:x], local_variables_of(binding), feature8773)
+ end
+
def test_global_variable_0
assert_in_out_err(["-e", "$0='t'*1000;print $0"], "", /\At+\z/, [])
end