From a19e3f3cd2e95553b5ea463fc8e4b35d72c6eef4 Mon Sep 17 00:00:00 2001 From: Kenta Murata Date: Wed, 23 Jun 2021 01:30:18 +0900 Subject: [PATCH] Fix the previous commit for multiple arguments [Fix GH-303] --- lib/iruby/backend.rb | 4 ++-- test/iruby/backend_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/iruby/backend.rb b/lib/iruby/backend.rb index 8b564f5..e170051 100644 --- a/lib/iruby/backend.rb +++ b/lib/iruby/backend.rb @@ -65,8 +65,8 @@ def complete(code) def init_main_object(main) wrapper_module = Module.new main.extend(wrapper_module) - main.define_singleton_method(:include) do |mod| - wrapper_module.include(mod) + main.define_singleton_method(:include) do |*args, **kwargs| + wrapper_module.include(*args, **kwargs) end end end diff --git a/test/iruby/backend_test.rb b/test/iruby/backend_test.rb index 161688d..3470b49 100644 --- a/test/iruby/backend_test.rb +++ b/test/iruby/backend_test.rb @@ -10,7 +10,7 @@ def test_eval_one_plus_two def test_include_module assert_nothing_raised do - @plainbackend.eval("include Math", false) + @plainbackend.eval("include Math, Comparable", false) end end @@ -34,7 +34,7 @@ def test_eval_one_plus_two def test_include_module assert_nothing_raised do - @prybackend.eval("include Math", false) + @prybackend.eval("include Math, Comparable", false) end end