rspec - standalone test runner for Ruby RSpec test suites
Contents
Description
The Ruby script rspec allows you to run tests written with RSpec, a testing tool for Ruby, from the
command line. When run without arguments, rspec finds automatically all the spec files of your projects,
and runs them. It is possible to restrict the tests to a subset by specifying the names of particular
spec files or by using some of the filtering options.
Various options can be passed to rspec to modify the output of the tests, or the way the tests are run.
Filtering And Tag Options
In addition to the following options for selecting specific files, groups, or examples, you can select a
single example by appending the line number to the filename:
rspec path/to/a_spec.rb:37
-P, --patternPATTERN
Load files matching pattern (default: "spec/**/*_spec.rb").
-e, --exampleSTRING
Run examples whose full nested names include STRING.
-l, --line_numberLINE
Specify line number of an example or group (may be used more than once).
-t, --tagTAG[:VALUE]
Run examples with the specified tag, or exclude examples by adding ~ before the tag, e.g. ~slow. TAG
is always converted to a symbol.
--default_pathPATH
Set the default path where RSpec looks for examples (can be a path to a file or a directory).
Name
rspec - standalone test runner for Ruby RSpec test suites
Options
-IPATH
Specify PATH to add to $LOAD_PATH (may be used more than once).
-r, --requirePATH
Require a file.
-O, --optionsPATH
Specify the path to a custom options file.
--orderTYPE[:SEED]
Run examples by the specified order type. TYPE can be either default, for which files are ordered
based on the underlying file system's order, or rand, for which the order of files, groups and
examples is randomized. random is an alias for rand. A SEED can be indicated for the random type,
e.g. --orderrandom:123
--seedSEED
Equivalent of --orderrand:SEED.
-d, --debugger
Enable debugging.
--fail-fast
Abort the run on first failure.
--failure-exit-codeCODE
Override the exit code used when there are failing specs.
-X, --[no-]drb
Run examples via DRb.
--drb-portPORT
Port to connect to the DRb server.
--init
Initialize your project with RSpec.
--configure
Deprecated. Use --init instead.
Output Options
-f, --formatFORMATTER
Choose a formatter. The various choices are [p]rogress (default - dots), [d]ocumentation (group and
example names), [h]tml, [t]extmate or a custom formatter class name.
-o, --outFILE
Write output to a file instead of STDOUT. This option applies to the previously specified --format,
or the default format if no format is specified.
-b, --backtrace
Enable full backtrace.
-c, --[no-]color, --[no-]colour
Enable color in the output.
-p, --profile
Enable profiling of examples and list 10 slowest examples.
Synopsys
rspec [options] [filesordirectories]
Utility Options
-v, --version
Display the version.
-h, --help
Display a message similar to this manpage.
