diff --git a/spec/support/rails_stub_application.rb b/spec/support/rails_stub_application.rb index 0784707..41701ae 100644 --- a/spec/support/rails_stub_application.rb +++ b/spec/support/rails_stub_application.rb @@ -1,15 +1,17 @@ RSpec.configure do |config| config.before(:example) do - without_partial_double_verification do - deprecators = ActiveSupport::Deprecation::Deprecators.new.tap do |deprecators| - deprecators[:rails] = ActiveSupport::Deprecation.new + if ActiveSupport.version >= Gem::Version.new("7.1.0") + without_partial_double_verification do + deprecators = ActiveSupport::Deprecation::Deprecators.new.tap do |deprecators| + deprecators[:rails] = ActiveSupport::Deprecation.new + end + mock_app = OpenStruct.new(deprecators: deprecators) + allow(Rails) + .to receive(:application) + .and_return(mock_app) end - mock_app = OpenStruct.new(deprecators: deprecators) - allow(Rails) - .to receive(:application) - .and_return(mock_app) + WarningSigns::World.instance.rails_set_up end - WarningSigns::World.instance.rails_set_up end end