@@ -1250,21 +1250,6 @@ def configure_group(group)
1250
1250
configure_group_with group , @prepend_modules , :safe_prepend
1251
1251
end
1252
1252
1253
- # @private
1254
- def configure_group_with ( group , module_list , application_method )
1255
- module_list . items_for ( group . metadata ) . each do |mod |
1256
- __send__ ( application_method , mod , group )
1257
- end
1258
- end
1259
-
1260
- # @private
1261
- def configure_existing_groups ( mod , meta , application_method )
1262
- world . all_example_groups . each do |group |
1263
- next unless meta . empty? || MetadataFilter . apply? ( :any? , meta , group . metadata )
1264
- __send__ ( application_method , mod , group )
1265
- end
1266
- end
1267
-
1268
1253
# @private
1269
1254
#
1270
1255
# Used internally to extend the singleton class of a single example's
@@ -1284,13 +1269,6 @@ def configure_example(example)
1284
1269
end
1285
1270
end
1286
1271
1287
- if RSpec ::Support ::RubyFeatures . module_prepends_supported?
1288
- # @private
1289
- def safe_prepend ( mod , host )
1290
- host . __send__ ( :prepend , mod ) unless host < mod
1291
- end
1292
- end
1293
-
1294
1272
# @private
1295
1273
def requires = ( paths )
1296
1274
directories = [ 'lib' , default_path ] . select { |p | File . directory? p }
@@ -1308,31 +1286,6 @@ def in_project_source_dir_regex
1308
1286
Regexp . union ( regexes )
1309
1287
end
1310
1288
1311
- # @private
1312
- if RUBY_VERSION . to_f >= 1.9
1313
- # @private
1314
- def safe_include ( mod , host )
1315
- host . __send__ ( :include , mod ) unless host < mod
1316
- end
1317
-
1318
- # @private
1319
- def safe_extend ( mod , host )
1320
- host . extend ( mod ) unless host . singleton_class < mod
1321
- end
1322
- else # for 1.8.7
1323
- # :nocov:
1324
- # @private
1325
- def safe_include ( mod , host )
1326
- host . __send__ ( :include , mod ) unless host . included_modules . include? ( mod )
1327
- end
1328
-
1329
- # @private
1330
- def safe_extend ( mod , host )
1331
- host . extend ( mod ) unless ( class << host ; self ; end ) . included_modules . include? ( mod )
1332
- end
1333
- # :nocov:
1334
- end
1335
-
1336
1289
# @private
1337
1290
def configure_mock_framework
1338
1291
RSpec ::Core ::ExampleGroup . __send__ ( :include , mock_framework )
@@ -1866,6 +1819,45 @@ def clear_values_derived_from_example_status_persistence_file_path
1866
1819
@last_run_statuses = nil
1867
1820
@spec_files_with_failures = nil
1868
1821
end
1822
+
1823
+ def configure_group_with ( group , module_list , application_method )
1824
+ module_list . items_for ( group . metadata ) . each do |mod |
1825
+ __send__ ( application_method , mod , group )
1826
+ end
1827
+ end
1828
+
1829
+ def configure_existing_groups ( mod , meta , application_method )
1830
+ world . all_example_groups . each do |group |
1831
+ next unless meta . empty? || MetadataFilter . apply? ( :any? , meta , group . metadata )
1832
+ __send__ ( application_method , mod , group )
1833
+ end
1834
+ end
1835
+
1836
+ if RSpec ::Support ::RubyFeatures . module_prepends_supported?
1837
+ def safe_prepend ( mod , host )
1838
+ host . __send__ ( :prepend , mod ) unless host < mod
1839
+ end
1840
+ end
1841
+
1842
+ if RUBY_VERSION . to_f >= 1.9
1843
+ def safe_include ( mod , host )
1844
+ host . __send__ ( :include , mod ) unless host < mod
1845
+ end
1846
+
1847
+ def safe_extend ( mod , host )
1848
+ host . extend ( mod ) unless host . singleton_class < mod
1849
+ end
1850
+ else # for 1.8.7
1851
+ # :nocov:
1852
+ def safe_include ( mod , host )
1853
+ host . __send__ ( :include , mod ) unless host . included_modules . include? ( mod )
1854
+ end
1855
+
1856
+ def safe_extend ( mod , host )
1857
+ host . extend ( mod ) unless ( class << host ; self ; end ) . included_modules . include? ( mod )
1858
+ end
1859
+ # :nocov:
1860
+ end
1869
1861
end
1870
1862
# rubocop:enable Metrics/ClassLength
1871
1863
end
0 commit comments