Move Kernel#__send__ test to core from mruby-metaprog

This commit is contained in:
KOBAYASHI Shuji
2019-06-21 22:02:29 +09:00
parent c53b7cedcc
commit c43ff6fa40
2 changed files with 14 additions and 14 deletions
-14
View File
@@ -1,17 +1,3 @@
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#send', '15.3.1.3.44') do
# test with block
l = send(:lambda) do
+14
View File
@@ -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?