--order option to tell RSpec how to order the files, groups, and
examples. The available ordering schemes are
defined is the default, which executes groups and examples in the order they
are defined as the spec files are loaded, with the caveat that each group
runs its examples before running its nested example groups, even if the
nested groups are defined before the examples.
rand to randomize the order of groups and examples within the groups.
Nested groups are always run from top-level to bottom-level in order to avoid
after(:context) hooks more than once, but the
order of groups at each level is randomized.
rand you can also specify a seed.
recently-modified to run the most recently modified files first. You can
combine it with
--only-failures to find the most recent failing specs. Note
rand are mutually exclusive.
defined option is only necessary when you have
--order rand stored in a
config file (e.g.
.rspec) and you want to override it from the command line.
--seed 123 # same as --order rand:123