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β specifyPATHto 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.TYPEcan be eitherdefault, where files are ordered based on the underlying file system's order, orrand, where the order of files, groups and examples is randomized.randomis an alias forrand. you can also hand over aSEEDfor 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--initinstead. 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]extmateor a custom formatter class name. pick your aesthetic π-o,--out FILEβ write output to a file instead ofSTDOUT. 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 includeSTRING.-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.TAGis 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
- ubuntu stonking: ruby-rspec-core 3.13.2c6e5m8s7-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms