Skip to content

Commit 9fd8b33

Browse files
authored
Merge pull request rails#51653 from Earlopain/fixup-51619
Fix Ruby 3.4 internal frame cleaner test
2 parents c810651 + 13dc2e7 commit 9fd8b33

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

activesupport/test/deprecation_test.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -979,18 +979,20 @@ def generated_method_that_call_deprecation(deprecator)
979979
@deprecator.behavior = ->(message, *) { @message = message }
980980
method_that_emits_deprecation_with_internal_method(@deprecator)
981981

982-
assert_not_includes(@message, "internal")
982+
assert_includes(@message, "/path/to/user/code.rb")
983983
end
984984

985+
class_eval(<<~RUBY, "/path/to/user/code.rb", 1)
986+
def method_that_emits_deprecation_with_internal_method(deprecator)
987+
[1].each { deprecator.warn }
988+
end
989+
RUBY
990+
985991
private
986992
def method_that_emits_deprecation(deprecator)
987993
deprecator.warn
988994
end
989995

990-
def method_that_emits_deprecation_with_internal_method(deprecator)
991-
[1].each { deprecator.warn }
992-
end
993-
994996
def with_rails_application_deprecators(&block)
995997
application = Struct.new(:deprecators).new(ActiveSupport::Deprecation::Deprecators.new)
996998
rails = Struct.new(:application).new(application)

0 commit comments

Comments
 (0)