summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-05-20 11:27:06 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-05-20 11:27:06 +0900
commit7195600dbf8d1683bcc5e9bfc3dd8547c222694e (patch)
treecd6841e739d9ed84078bed65cd3abe7cc9c5873a /test
parent4b6de9dea6f630b62db12102b9212740f935b9b6 (diff)
parent4004e122a28f48206dc1f39c731993c632d7ac6a (diff)
downloadmruby-7195600dbf8d1683bcc5e9bfc3dd8547c222694e.tar.gz
mruby-7195600dbf8d1683bcc5e9bfc3dd8547c222694e.zip
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'test')
-rw-r--r--test/t/kernel.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/t/kernel.rb b/test/t/kernel.rb
index be3c99a90..427d71e36 100644
--- a/test/t/kernel.rb
+++ b/test/t/kernel.rb
@@ -507,6 +507,20 @@ assert('Kernel#to_s', '15.3.1.3.46') do
assert_equal to_s.class, String
end
+assert('Kernel.local_variables', '15.3.1.2.7') do
+ a, b = 0, 1
+ a += b
+
+ vars = Kernel.local_variables.sort
+ assert_equal [:a, :b, :vars], vars
+
+ Proc.new {
+ c = 2
+ vars = Kernel.local_variables.sort
+ assert_equal [:a, :b, :c, :vars], vars
+ }.call
+end
+
assert('Kernel#!=') do
str1 = "hello"
str2 = str1