1- # rubocop: disable Metrics/ModuleLength
21module RSpec
32 module Rails
43 # Fake class to document RSpec Rails configuration options. In practice,
@@ -57,7 +56,7 @@ def self.add_test_type_configurations(config)
5756 end
5857
5958 # @private
60- def self . initialize_configuration ( config ) # rubocop:disable Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/AbcSize,Metrics/PerceivedComplexity
59+ def self . initialize_configuration ( config ) # rubocop:disable Metrics/MethodLength
6160 config . backtrace_exclusion_patterns << /vendor\/ /
6261 config . backtrace_exclusion_patterns << %r{lib/rspec/rails}
6362
@@ -69,12 +68,7 @@ def self.initialize_configuration(config) # rubocop:disable Metrics/MethodLength
6968 config . add_setting :use_transactional_fixtures , alias_with : :use_transactional_examples
7069 config . add_setting :use_instantiated_fixtures
7170 config . add_setting :global_fixtures
72-
73- if ::Rails ::VERSION ::STRING < "7.1.0"
74- config . add_setting :fixture_path
75- else
76- config . add_setting :fixture_paths
77- end
71+ config . add_setting :fixture_paths
7872
7973 config . include RSpec ::Rails ::FixtureSupport , :use_fixtures
8074
@@ -90,7 +84,7 @@ def self.initialize_configuration(config) # rubocop:disable Metrics/MethodLength
9084 config . add_setting :file_fixture_path , default : 'spec/fixtures/files'
9185 config . include RSpec ::Rails ::FileFixtureSupport
9286
93- # Add support for fixture_path on fixture_file_upload
87+ # Add support for fixture_paths on fixture_file_upload
9488 config . include RSpec ::Rails ::FixtureFileUploadSupport
9589
9690 # This allows us to expose `render_views` as a config option even though it
@@ -114,40 +108,6 @@ def render_views?
114108 rendering_views?
115109 end
116110
117- undef :rendering_views? if respond_to? ( :rendering_views? )
118- def rendering_views?
119- !!rendering_views
120- end
121-
122- # Define boolean predicates rather than relying on rspec-core due
123- # to the bug fix in rspec/rspec-core#2736, note some of these
124- # predicates are a bit nonsensical, but they exist for backwards
125- # compatibility, we can tidy these up in `rspec-rails` 5.
126- undef :fixture_path? if respond_to? ( :fixture_path? )
127- def fixture_path?
128- !!fixture_path
129- end
130-
131- undef :global_fixtures? if respond_to? ( :global_fixtures? )
132- def global_fixtures?
133- !!global_fixtures
134- end
135-
136- undef :infer_base_class_for_anonymous_controllers? if respond_to? ( :infer_base_class_for_anonymous_controllers? )
137- def infer_base_class_for_anonymous_controllers?
138- !!infer_base_class_for_anonymous_controllers
139- end
140-
141- undef :use_instantiated_fixtures? if respond_to? ( :use_instantiated_fixtures? )
142- def use_instantiated_fixtures?
143- !!use_instantiated_fixtures
144- end
145-
146- undef :use_transactional_fixtures? if respond_to? ( :use_transactional_fixtures? )
147- def use_transactional_fixtures?
148- !!use_transactional_fixtures
149- end
150-
151111 def infer_spec_type_from_file_location!
152112 DIRECTORY_MAPPINGS . each do |type , dir_parts |
153113 escaped_path = Regexp . compile ( dir_parts . join ( '[\\\/]' ) + '[\\\/]' )
@@ -163,29 +123,6 @@ def filter_rails_from_backtrace!
163123 filter_gems_from_backtrace "activemodel" , "activerecord" ,
164124 "activesupport" , "activejob"
165125 end
166-
167- # @deprecated TestFixtures#fixture_path is deprecated and will be removed in Rails 7.2
168- if ::Rails ::VERSION ::STRING >= "7.1.0"
169- def fixture_path
170- RSpec . deprecate (
171- "config.fixture_path" ,
172- replacement : "config.fixture_paths" ,
173- message : "Rails 7.1 has deprecated the singular fixture_path in favour of an array." \
174- "You should migrate to plural:"
175- )
176- fixture_paths &.first
177- end
178-
179- def fixture_path = ( path )
180- RSpec . deprecate (
181- "config.fixture_path = #{ path . inspect } " ,
182- replacement : "config.fixture_paths = [#{ path . inspect } ]" ,
183- message : "Rails 7.1 has deprecated the singular fixture_path in favour of an array." \
184- "You should migrate to plural:"
185- )
186- self . fixture_paths = Array ( path )
187- end
188- end
189126 end
190127
191128 add_test_type_configurations ( config )
@@ -219,4 +156,3 @@ def fixture_path=(path)
219156 initialize_configuration RSpec . configuration
220157 end
221158end
222- # rubocop: enable Metrics/ModuleLength
0 commit comments