diff options
| author | dearblue <[email protected]> | 2021-02-22 22:14:46 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-02-22 22:14:46 +0900 |
| commit | 297c5ac5983ee0c90b85a189ab1effc630bad617 (patch) | |
| tree | 5de6138dc31f52c7daeb05925a37ae22fdf5388e /mrbgems/mruby-binding/test | |
| parent | d64c7330bc847ac2b6ae078e837c6dcdd3605381 (diff) | |
| parent | e8988197f24d19558353f945f6c5f106211491b0 (diff) | |
| download | mruby-297c5ac5983ee0c90b85a189ab1effc630bad617.tar.gz mruby-297c5ac5983ee0c90b85a189ab1effc630bad617.zip | |
Merge branch 'binding' of https://github.com/ksss/mruby into HEAD
Diffstat (limited to 'mrbgems/mruby-binding/test')
| -rw-r--r-- | mrbgems/mruby-binding/test/binding.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mrbgems/mruby-binding/test/binding.rb b/mrbgems/mruby-binding/test/binding.rb new file mode 100644 index 000000000..3bed9b31e --- /dev/null +++ b/mrbgems/mruby-binding/test/binding.rb @@ -0,0 +1,17 @@ +assert("Kernel.#binding") do + assert_kind_of Binding, binding +end + +assert("Binding#local_variables") do + block = Proc.new do |a| + b = 1 + binding + end + assert_equal [:a, :b, :block], block.call(0).local_variables +end + +assert("Binding#eval") do + b = nil + 1.times { x, y, z = 1, 2, 3; [x,y,z]; b = binding } + assert_equal([1, 2, 3], b.eval("[x, y, z]")) +end |
