Skip to content

Commit

Permalink
Make the ActiveSupport deprecator raise to ensure no deprecated behavior
Browse files Browse the repository at this point in the history
This also removed the deprecated behavior of setting the behavior of the
ActiveSupport::Deprecation singleton.

Co-authored-by: Adrianna Chang <[email protected]>
  • Loading branch information
etiennebarrie and adrianna-chang-shopify committed Nov 17, 2023
1 parent db5a2da commit 7903746
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
DeprecationToolkit::Configuration.test_runner = :rspec
DeprecationToolkit::Configuration.deprecation_path = "spec/deprecations"

if ActiveSupport.respond_to?(:deprecator)
ActiveSupport.deprecator.behavior = :raise
else
ActiveSupport::Deprecation.behavior = :raise
end

RSpec.configure do |config|
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
Expand Down
6 changes: 5 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
require_relative "support/test_deprecator"
require_relative "support/fake_rails"

ActiveSupport::Deprecation.behavior = :silence
if ActiveSupport.respond_to?(:deprecator)
ActiveSupport.deprecator.behavior = :raise
else
ActiveSupport::Deprecation.behavior = :raise
end
ActiveSupport::TestCase.test_order = :random

0 comments on commit 7903746

Please sign in to comment.