summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-method/test/method.rb
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-09-16 07:49:43 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2019-09-16 10:10:09 +0900
commit3daa53ce6335e265e3579534fa199ef458047865 (patch)
treec84aea94ab1547d07b54b185e42152bb6dcb1f87 /mrbgems/mruby-method/test/method.rb
parenta016d1d0ffb58314beb17ccd6d018fbe606c234f (diff)
downloadmruby-3daa53ce6335e265e3579534fa199ef458047865.tar.gz
mruby-3daa53ce6335e265e3579534fa199ef458047865.zip
Implement `bind_call` method from Ruby2.7.
Diffstat (limited to 'mrbgems/mruby-method/test/method.rb')
-rw-r--r--mrbgems/mruby-method/test/method.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-method/test/method.rb b/mrbgems/mruby-method/test/method.rb
index 0b67d3e61..641979d71 100644
--- a/mrbgems/mruby-method/test/method.rb
+++ b/mrbgems/mruby-method/test/method.rb
@@ -441,3 +441,11 @@ assert 'UnboundMethod#bind' do
assert_raise(TypeError) { Array.instance_method(:each).bind(1) }
assert_kind_of Method, Object.instance_method(:object_id).bind(Object.new)
end
+
+assert 'UnboundMethod#bind_call' do
+ m = Array.instance_method(:size)
+ assert_equal(:size, m.name)
+ assert_equal(0, m.bind_call([]))
+ assert_equal(1, m.bind_call([1]))
+ assert_equal(2, m.bind_call([1,2]))
+end