X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=third-party%2Fmruby%2Fmrbgems%2Fmruby-method%2Ftest%2Fmethod.rb;h=641979d716563509954eac9c43f9d6ba0dafed5f;hb=20be57735fcdeee837010ed1f8b1972e299d2a60;hp=dfddde9cc8eed330eb425e67f97f325f51c9391a;hpb=3ae7c5393d49f1fec511f2956f82a8cbfc8fc286;p=platform%2Fupstream%2Fnghttp2.git diff --git a/third-party/mruby/mrbgems/mruby-method/test/method.rb b/third-party/mruby/mrbgems/mruby-method/test/method.rb index dfddde9..641979d 100644 --- a/third-party/mruby/mrbgems/mruby-method/test/method.rb +++ b/third-party/mruby/mrbgems/mruby-method/test/method.rb @@ -21,7 +21,7 @@ class Interpreter } def interpret(string) @ret = "" - string.each_char {|b| Dispatcher[b].bind(self).call } + string.split("").each {|b| Dispatcher[b].bind(self).call } end end @@ -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