Skip to content

Commit 13958cc

Browse files
javierjulioJonRowe
authored andcommitted
Account for all known cases
This now matches what Rails 7+ does
1 parent f35b3a6 commit 13958cc

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

lib/rspec/rails/example/rails_example_group.rb

+10-7
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ module RailsExampleGroup
1212
include RSpec::Rails::MinitestLifecycleAdapter
1313
include RSpec::Rails::MinitestAssertionAdapter
1414
include RSpec::Rails::FixtureSupport
15-
include RSpec::Rails::TaggedLoggingAdapter if ::Rails::VERSION::MAJOR >= 7
1615

1716
if ::Rails::VERSION::MAJOR >= 7
1817
include RSpec::Rails::TaggedLoggingAdapter
19-
include ActiveSupport::ExecutionContext::TestHelper
20-
included do |_other|
21-
around do |example|
22-
if ::Rails.configuration.active_support.executor_around_test_case
18+
19+
if ::Rails.configuration.active_support.executor_around_test_case
20+
included do |_other|
21+
around do |example|
2322
::Rails.application.executor.perform { example.call }
24-
else
25-
example.call
2623
end
2724
end
25+
else
26+
require 'active_support/current_attributes/test_helper'
27+
include ActiveSupport::CurrentAttributes::TestHelper
28+
29+
require 'active_support/execution_context/test_helper'
30+
include ActiveSupport::ExecutionContext::TestHelper
2831
end
2932
end
3033
end

0 commit comments

Comments
 (0)