summaryrefslogtreecommitdiff
path: root/test/ruby/test_proc.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:57:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-01 17:57:37 +0000
commit1a2b90d5e6c7b6ecd1d4c0ba9445fb730b39776b (patch)
tree973b19a521528d0a87c2c77e7f57cd6707f1cb38 /test/ruby/test_proc.rb
parent0fdb18e513b53e71911c57a7b5fddd86c3a17704 (diff)
vm.c: rb_vm_env_local_variables
* vm.c (rb_vm_env_local_variables): returns array of local variable name symbols in the environment by envval. * proc.c (bind_local_variables): use rb_vm_env_local_variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_proc.rb')
-rw-r--r--test/ruby/test_proc.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 91279d9d75..28ba8c9b57 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -1253,7 +1253,9 @@ class TestProc < Test::Unit::TestCase
def test_local_variables
b = get_binding
- assert_equal(%i[if case when begin end a], b.local_variables)
+ assert_equal(%i'if case when begin end a', b.local_variables)
+ a = tap {|;a, b| break binding.local_variables}
+ assert_equal(%i[a b], a.sort)
end
def test_local_variables_nested