diff --git a/activesupport/test/deprecation_test.rb b/activesupport/test/deprecation_test.rb index 3ff2d7ffe7..520623df11 100644 --- a/activesupport/test/deprecation_test.rb +++ b/activesupport/test/deprecation_test.rb @@ -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)