@@ -1389,8 +1389,11 @@ def self.delegate_to_ordering_manager(*methods)
1389
1389
1390
1390
# @macro delegate_to_ordering_manager
1391
1391
#
1392
- # Sets the default global order and, if order is `'rand:<seed>'`, also
1393
- # sets the seed.
1392
+ # Sets the default global ordering strategy. By default this can be one
1393
+ # of `:defined`, `:random`, but is customisable through the
1394
+ # `register_ordering` API. See #register_ordering.
1395
+ #
1396
+ # If order is set to `'rand:<seed>'`, the seed will also be set.
1394
1397
delegate_to_ordering_manager :order=
1395
1398
1396
1399
# @macro delegate_to_ordering_manager
@@ -1412,13 +1415,32 @@ def self.delegate_to_ordering_manager(*methods)
1412
1415
# end
1413
1416
# end
1414
1417
#
1415
- # describe MyClass, :order => :reverse do
1418
+ # RSpec. describe ' MyClass' , :order => :reverse do
1416
1419
# # ...
1417
1420
# end
1418
1421
#
1419
1422
# @note Pass the symbol `:global` to set the ordering strategy that
1420
1423
# will be used to order the top-level example groups and any example
1421
1424
# groups that do not have declared `:order` metadata.
1425
+ #
1426
+ # @example
1427
+ # RSpec.configure do |rspec|
1428
+ # rspec.register_ordering :global do |examples|
1429
+ # acceptance, other = examples.partition do |example|
1430
+ # example.metadata[:type] == :acceptance
1431
+ # end
1432
+ # other + acceptance
1433
+ # end
1434
+ # end
1435
+ #
1436
+ # RSpec.describe 'MyClass', :type => :acceptance
1437
+ # # will run last
1438
+ # end
1439
+ #
1440
+ # RSpec.describe 'MyClass', :type => :unit
1441
+ # # will run first
1442
+ # end
1443
+ #
1422
1444
delegate_to_ordering_manager :register_ordering
1423
1445
1424
1446
# @private
0 commit comments