Skip to content

Commit

Permalink
Account for all known cases
Browse files Browse the repository at this point in the history
This now matches what Rails 7+ does
  • Loading branch information
javierjulio authored and JonRowe committed Apr 10, 2024
1 parent f35b3a6 commit 13958cc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/rspec/rails/example/rails_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,22 @@ module RailsExampleGroup
include RSpec::Rails::MinitestLifecycleAdapter
include RSpec::Rails::MinitestAssertionAdapter
include RSpec::Rails::FixtureSupport
include RSpec::Rails::TaggedLoggingAdapter if ::Rails::VERSION::MAJOR >= 7

if ::Rails::VERSION::MAJOR >= 7
include RSpec::Rails::TaggedLoggingAdapter
include ActiveSupport::ExecutionContext::TestHelper
included do |_other|
around do |example|
if ::Rails.configuration.active_support.executor_around_test_case

if ::Rails.configuration.active_support.executor_around_test_case
included do |_other|
around do |example|
::Rails.application.executor.perform { example.call }
else
example.call
end
end
else
require 'active_support/current_attributes/test_helper'
include ActiveSupport::CurrentAttributes::TestHelper

require 'active_support/execution_context/test_helper'
include ActiveSupport::ExecutionContext::TestHelper
end
end
end
Expand Down

0 comments on commit 13958cc

Please sign in to comment.