Skip to content

Commit

Permalink
Merge pull request rails#51653 from Earlopain/fixup-51619
Browse files Browse the repository at this point in the history
Fix Ruby 3.4 internal frame cleaner test
  • Loading branch information
rafaelfranca committed Apr 24, 2024
2 parents c810651 + 13dc2e7 commit 9fd8b33
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions activesupport/test/deprecation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9fd8b33

Please sign in to comment.