A specification can be run for each file or for definition.
Usage: spec (FILE(:LINE)?|DIRECTORY|GLOB)+ [options]
, . ( ) .
spec spec/models/customer_spec.rb:25
"spec" rails.
Usage: spec (FILE(:LINE)?|DIRECTORY|GLOB)+ [options]
-p,
Separate multiple patterns with commas.
Applies only to directories named on the command line (files
named explicitly on the command line will be loaded regardless).
-D,
Builtin formats: unified|u|context|c
You can also specify a custom differ class
(in which case you should also specify
-c,
-e,
the path to an existing file (typically generated by a previous
run using
on each line of that file will be executed. If the file is empty,
all examples will be run (as if
If the argument is not an existing file, then it is treated as
an example name directly, causing RSpec to run just the example
matching that name
-s,
(This will be removed when autotest works with -e)
-l,
(does not work for dynamically generated examples)
-f,
the formatter where to write the output. All built-in formats
expect WHERE to be a file name, and will write to $stdout if it's
not specified. The --format option may be specified several times
if you want several outputs
Builtin formats:
silent|l : No output
progress|p : Text-based progress bar
profile|o : Text-based progress bar with profiling of 10 slowest examples
specdoc|s : Code example doc strings
nested|n : Code example doc strings with nested groups indented
html|h : A nice HTML report
failing_examples|e : Write all failing examples - input for --example
failing_example_groups|g : Write all failing example groups - input for --example
FORMAT can also be the name of a custom formatter class
(in which case you should also specify --require to load it)
-r, --require FILE Require FILE before running specs
Useful for loading custom formatters or other extensions.
If this option is used it must come before the others
-b, --backtrace Output full backtrace
-L, --loadby STRATEGY Specify the strategy by which spec files should be loaded.
STRATEGY can currently only be 'mtime' (File modification time)
By default, spec files are loaded in alphabetical order if --loadby
is not specified.
-R, --reverse Run examples in reverse order
-t, --timeout FLOAT Interrupt and fail each example that doesn't complete in the
specified time
-H,
identified by CODE little by little and run all the examples again
for each mutation. The intent is that for each mutation, at least
one example *should* fail, and RSpec will tell you if this is not the
case. CODE should be either Some::Module, Some::Class or
Some::Fabulous
-d,
-O,
-G,
-U,
-u,
-X,
-v,
-h,