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