Skip to content

Commit

Permalink
Merge pull request #541 from flori/support-old-ruby
Browse files Browse the repository at this point in the history
alias_method is private on Ruby 2.3 and 2.4
  • Loading branch information
hsbt committed Sep 13, 2023
2 parents d81a22c + 573ef94 commit 9a8c4c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/json_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def to_s; self; end
def test_string_ext_included_calls_super
included = false

Module.alias_method(:included_orig, :included)
Module.send(:alias_method, [:included_orig, :included])
Module.remove_method(:included)
Module.define_method(:included) do |base|
included_orig(base)
Expand All @@ -410,7 +410,7 @@ def test_string_ext_included_calls_super
ensure
if Module.private_method_defined?(:included_orig)
Module.remove_method(:included) if Module.method_defined?(:included)
Module.alias_method(:included, :included_orig)
Module.send(:alias_method, [:included, :included_orig])
Module.remove_method(:included_orig)
end
end
Expand Down

0 comments on commit 9a8c4c9

Please sign in to comment.