Skip to content

Commit

Permalink
remove_method of Module is private at Ruby 2.3 and 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Oct 11, 2023
1 parent 8743a0b commit 6cbadf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/json_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6cbadf6

Please # to comment.