Skip to content

Commit

Permalink
Allow to set Rails deprecations behavior during tests
Browse files Browse the repository at this point in the history
Set the desired deprecation behavior via RAILS_DEPRECATIONS_BEHAVIOR
ENV var. Defaults to :stderr. Possible values are

  - raise - Raise ActiveSupport::DeprecationException.
  - stderr - Log all deprecation warnings to $stderr.
  - log - Log all deprecation warnings to Rails.logger.
  - notify - Use ActiveSupport::Notifications to notify deprecation.rails.
  - report - Use ActiveSupport::ErrorReporter to report deprecations.
  - silence - Do nothing

Refs: https://api.rubyonrails.org/classes/ActiveSupport/Deprecation/Behavior.html
  • Loading branch information
tvdeyen committed Dec 4, 2024
1 parent 81c605c commit 5afadd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Application < ::Rails::Application
config.action_dispatch.show_exceptions = false
end
config.consider_all_requests_local = true
config.active_support.deprecation = :stderr
config.active_support.deprecation = ENV['RAILS_DEPRECATIONS_BEHAVIOR'].presence&.to_sym || :stderr
config.log_level = :debug

# Improve test suite performance:
Expand Down

0 comments on commit 5afadd7

Please sign in to comment.