diff options
| author | KOBAYASHI Shuji <[email protected]> | 2019-06-21 22:02:29 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2019-06-21 22:02:29 +0900 |
| commit | c43ff6fa4063d22db391ab1818b121110ca520bf (patch) | |
| tree | 4eb4ca1f24c34f9ba65a19991e6234bbbb2afe89 /test/t | |
| parent | c53b7cedccf7f5260dc8b4f88c5f93ea550bc5df (diff) | |
| download | mruby-c43ff6fa4063d22db391ab1818b121110ca520bf.tar.gz mruby-c43ff6fa4063d22db391ab1818b121110ca520bf.zip | |
Move `Kernel#__send__` test to core from `mruby-metaprog`
Diffstat (limited to 'test/t')
| -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 950442351..103660f53 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -88,6 +88,20 @@ assert('Kernel#__id__', '15.3.1.3.3') do assert_equal Fixnum, __id__.class end +assert('Kernel#__send__', '15.3.1.3.4') do + # test with block + l = __send__(:lambda) do + true + end + + assert_true l.call + assert_equal Proc, l.class + # test with argument + assert_true __send__(:respond_to?, :nil?) + # test without argument and without block + assert_equal String, __send__(:to_s).class +end + assert('Kernel#block_given?', '15.3.1.3.6') do def bg_try(&b) if block_given? |
