Fix Ruby 3.4 internal frame cleaner test

Fixup for c85eca47f0d5845bb23a252748610b6cc618c673
This commit is contained in:
Earlopain 2024-04-24 08:59:03 +02:00
parent 3e156142bf
commit 13dc2e7a1c
No known key found for this signature in database
GPG Key ID: 298A57787DC6EF08

@ -979,18 +979,20 @@ def generated_method_that_call_deprecation(deprecator)
@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)