diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-20 11:21:31 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-05-20 11:21:31 +0900 |
| commit | 4004e122a28f48206dc1f39c731993c632d7ac6a (patch) | |
| tree | d758c460fec7423b6e23dcf0fd962fde978ee6fb /test/t/kernel.rb | |
| parent | c4268f67d052aa55f9cce3307d846285f1e6519b (diff) | |
| parent | d8d07a234507e63a3ffad65309a62b484028381e (diff) | |
| download | mruby-4004e122a28f48206dc1f39c731993c632d7ac6a.tar.gz mruby-4004e122a28f48206dc1f39c731993c632d7ac6a.zip | |
Merge pull request #2296 from take-cheeze/core_local_vars
Move `Kernel.local_variables` to core.
Diffstat (limited to 'test/t/kernel.rb')
| -rw-r--r-- | test/t/kernel.rb | 14 |
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 |
