@@ -161,21 +161,47 @@ def in_inferring_type_from_location_environment
161
161
include_examples "infers type from location" , :feature , "spec/features"
162
162
end
163
163
164
- if ::Rails ::VERSION ::STRING < "7.1.0"
165
- it "fixture support is included with metadata `:use_fixtures`" do
166
- in_sub_process do
167
- RSpec . configuration . global_fixtures = [ :foo ]
168
- RSpec . configuration . fixture_path = "custom/path"
164
+ it "fixture support is included with metadata `:use_fixtures`" do
165
+ in_sub_process do
166
+ a_hash = an_instance_of ( Hash )
167
+ if ::Rails ::VERSION ::STRING >= "7.1.0"
168
+ expect ( RSpec ) . to receive ( :deprecate ) . with ( "config.fixture_path = \" custom/path\" " , a_hash )
169
+ end
169
170
170
- group = RSpec . describe ( "Arbitrary Description" , :use_fixtures )
171
+ RSpec . configuration . global_fixtures = [ :foo ]
172
+ RSpec . configuration . fixture_path = "custom/path"
171
173
172
- expect ( group ) . to respond_to ( :fixture_path )
173
- expect ( group . fixture_path ) . to eq ( "custom/path" )
174
+ group = RSpec . describe ( "Arbitrary Description" , :use_fixtures )
174
175
175
- expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
176
+ expect ( group ) . to respond_to ( :fixture_path )
177
+
178
+ if ::Rails ::VERSION ::STRING >= "7.1.0"
179
+ with_isolated_stderr { expect ( group . fixture_path ) . to eq ( "custom/path" ) }
180
+ else
181
+ expect ( group . fixture_path ) . to eq ( "custom/path" )
176
182
end
183
+
184
+ expect ( group . new . respond_to? ( :foo , true ) ) . to be ( true )
185
+ end
186
+ end
187
+
188
+ if ::Rails ::VERSION ::STRING >= "7.1.0"
189
+ it "deprecates fixture_path" do
190
+ expect_deprecation_with_call_site ( __FILE__ , __LINE__ + 1 , "config.fixture_path" )
191
+ RSpec . configuration . fixture_path
192
+
193
+ RSpec . configuration . fixture_paths = [ ]
194
+ expect_deprecation_with_call_site ( __FILE__ , __LINE__ + 1 , "config.fixture_path" )
195
+ RSpec . configuration . fixture_path
177
196
end
178
- else
197
+
198
+ it "deprecates fixture_path =" do
199
+ expect_deprecation_with_call_site ( __FILE__ , __LINE__ + 1 , /config.fixture_path =/ )
200
+ RSpec . configuration . fixture_path = "some path"
201
+
202
+ expect ( RSpec . configuration . fixture_paths ) . to eq ( [ "some path" ] )
203
+ end
204
+
179
205
it "fixture support is included with metadata `:use_fixtures` and fixture_paths configured" do
180
206
in_sub_process do
181
207
RSpec . configuration . global_fixtures = [ :foo ]
0 commit comments