Merge pull request #51653 from Earlopain/fixup-51619

Fix Ruby 3.4 internal frame cleaner test
This commit is contained in:
Rafael Mendonça França 2024-04-24 12:19:54 -03:00 committed by GitHub
commit 9fd8b33ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -979,18 +979,20 @@ class DeprecationTest < ActiveSupport::TestCase
@deprecator.behavior = ->(message, *) { @message = message }
method_that_emits_deprecation_with_internal_method(@deprecator)
assert_not_includes(@message, "internal")
assert_includes(@message, "/path/to/user/code.rb")
end
class_eval(<<~RUBY, "/path/to/user/code.rb", 1)
def method_that_emits_deprecation_with_internal_method(deprecator)
[1].each { deprecator.warn }
end
RUBY
private
def method_that_emits_deprecation(deprecator)
deprecator.warn
end
def method_that_emits_deprecation_with_internal_method(deprecator)
[1].each { deprecator.warn }
end
def with_rails_application_deprecators(&block)
application = Struct.new(:deprecators).new(ActiveSupport::Deprecation::Deprecators.new)
rails = Struct.new(:application).new(application)