diff --git a/lib/rspec/rails/fixture_support.rb b/lib/rspec/rails/fixture_support.rb index 2161b115c6..02786d3c29 100644 --- a/lib/rspec/rails/fixture_support.rb +++ b/lib/rspec/rails/fixture_support.rb @@ -9,6 +9,13 @@ module FixtureSupport include RSpec::Rails::MinitestAssertionAdapter include ActiveRecord::TestFixtures + if ::Rails.version.to_f >= 6.1 + # @private return the example name for TestFixtures + def name + @example + end + end + included do if RSpec.configuration.use_active_record? include Fixtures @@ -50,13 +57,6 @@ def proxy_method_warning_if_called_in_before_context_scope(method_name) end end end - - if ::Rails.version.to_f >= 6.1 - # @private return the example name for TestFixtures - def name - @example - end - end end end end