RSPEC(1)

πŸ’– rspec(1) β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to rspec, the standalone test runner for your Ruby RSpec test suites. yes this is section 1 of the manual (man page energy πŸŽ€), and yes i'm about to explain every single flag because you deserve the full lore, no cap.


✨ NAME ✨

rspec β€” a standalone test runner for Ruby RSpec test suites. she runs your tests, she's the main character, periodt. πŸ‘‘


🌸 SYNOPSYS 🌸

rspec [options] [files or directories]

that's it. that's the whole vibe. options then files or dirs, go off. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the Ruby script rspec lets you run tests written with RSpec β€” a testing tool for Ruby β€” straight from the command line. iconic behavior honestly.

when you run it with no arguments at all, rspec will literally go find all the spec files in your projects by itself and run them. automatic. self-sufficient. not me being impressed by a script 😭

want to run just some of your tests? totally valid. you can restrict things to a subset by naming particular spec files, or by using some of the filtering options. your tests, your rules. 🫢

and you can pass rspec a whole bunch of options to change how the tests output looks or how the tests actually run. slay.


✨ OPTIONS ✨

  • -I PATH β€” specify PATH to add to $LOAD_PATH. you can use this more than once, so stack 'em up bestie πŸ’–
  • -r, --require PATH β€” require a file.
  • -O, --options PATH β€” specify the path to a custom options file.
  • --order TYPE[:SEED] β€” run examples by the specified order type. TYPE can be either default, where files are ordered based on the underlying file system's order, or rand, where the order of files, groups and examples is randomized. random is an alias for rand. you can also hand over a SEED for the random type, like --order random:123 🎲
  • --seed SEED β€” equivalent of --order rand:SEED. same energy, shorter spelling.
  • -d, --debugger β€” enable debugging. detective mode activated πŸ”
  • --fail-fast β€” abort the run on the first failure. no waiting around, we're leaving immediately πŸ’€
  • --failure-exit-code CODE β€” override the exit code used when there are failing specs.
  • -X, --[no-]drb β€” run examples via DRb.
  • --drb-port PORT β€” port to connect to the DRb server.
  • --init β€” initialize your project with RSpec. glow-up your repo ✨
  • --configure β€” Deprecated. use --init instead. she's retired, respect the retirement πŸ™ˆ

πŸŽ€ OUTPUT OPTIONS πŸŽ€

  • -f, --format FORMATTER β€” 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. pick your aesthetic πŸ’…
  • -o, --out FILE β€” 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. so order matters, iykyk πŸ‘€
  • -b, --backtrace β€” enable full backtrace.
  • -c, --[no-]color, --[no-]colour β€” enable color in the output. yes you can spell it both ways, we're inclusive here 🌈
  • -p, --profile β€” enable profiling of examples and list the 10 slowest examples. expose them fr fr 🐌

πŸ’œ 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

yes, just stick a :37 on the end. that's the whole trick. iconic.

  • -P, --pattern PATTERN β€” load files matching pattern (default: "spec/**/*_spec.rb").
  • -e, --example STRING β€” run examples whose full nested names include STRING.
  • -l, --line_number LINE β€” specify line number of an example or group (may be used more than once).
  • -t, --tag TAG[: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. always. don't fight it. πŸ”₯
  • --default_path PATH β€” set the default path where RSpec looks for examples (can be a path to a file or a directory).

⭐ UTILITY OPTIONS ⭐

  • -v, --version β€” display the version.
  • -h, --help β€” display a message similar to this manpage. (hi, that's me, i'm the message 🫢)

πŸ‘‘ AUTHORS πŸ‘‘

this man page β€” inspired by the help message of rspec β€” has been written by CΓ©dric Boutillier for the Debian Project, but may be used by others. giving credit where credit is due, always. πŸ’–


and that's the whole thing bestie, you're officially an rspec girlie now. πŸ’…βœ¨

little sign-off moment: this page is from the Debian project, dated 2026-08-07, sitting pretty in section RSPEC(1) of the manual. mwah. πŸŽ€πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from