From 6cbadf6b6e6a8fbed00e5f59737d5973e243532c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 11 Oct 2023 13:55:39 +0900 Subject: [PATCH 1/3] remove_method of Module is private at Ruby 2.3 and 2.4 --- tests/json_generator_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb index 20f652dc..2b9a11ef 100755 --- a/tests/json_generator_test.rb +++ b/tests/json_generator_test.rb @@ -396,7 +396,7 @@ def test_string_ext_included_calls_super included = false Module.send(:alias_method, :included_orig, :included) - Module.remove_method(:included) + Module.send(:remove_method, :included) Module.define_method(:included) do |base| included_orig(base) included = true @@ -409,9 +409,9 @@ def test_string_ext_included_calls_super assert included ensure if Module.private_method_defined?(:included_orig) - Module.remove_method(:included) if Module.method_defined?(:included) + Module.send(:remove_method, :included) if Module.method_defined?(:included) Module.send(:alias_method, :included, :included_orig) - Module.remove_method(:included_orig) + Module.send(:remove_method, :included_orig) end end end From 3804f38bf42c241f39678a1bd0971c37430235d5 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 11 Oct 2023 13:57:27 +0900 Subject: [PATCH 2/3] define_method is also private at Ruby 2.3 and 2.4 --- tests/json_generator_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/json_generator_test.rb b/tests/json_generator_test.rb index 2b9a11ef..64042a4e 100755 --- a/tests/json_generator_test.rb +++ b/tests/json_generator_test.rb @@ -397,7 +397,7 @@ def test_string_ext_included_calls_super Module.send(:alias_method, :included_orig, :included) Module.send(:remove_method, :included) - Module.define_method(:included) do |base| + Module.send(:define_method, :included) do |base| included_orig(base) included = true end From bab704eb49bed248cad63d6055aa0813672b0f5a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 11 Oct 2023 14:09:18 +0900 Subject: [PATCH 3/3] skip TruffleRuby --- tests/json_parser_test.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb index 220826a4..cc9a74a9 100644 --- a/tests/json_parser_test.rb +++ b/tests/json_parser_test.rb @@ -24,6 +24,9 @@ def test_argument_encoding end if defined?(Encoding::UTF_16) def test_error_message_encoding + # https://github.com/flori/json/actions/runs/6478148162/job/17589572890 + pend if RUBY_ENGINE == 'truffleruby' + bug10705 = '[ruby-core:67386] [Bug #10705]' json = ".\"\xE2\x88\x9A\"".force_encoding(Encoding::UTF_8) e = assert_raise(JSON::ParserError) {