File: README.md

package info (click to toggle)
ruby-rspec 3.13.0c0e0m0s1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,856 kB
  • sloc: ruby: 70,868; sh: 1,423; makefile: 99
file content (30 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Command line options

The `rspec` command comes with several options you can use to customize RSpec's
behavior, including output formats, filtering examples, etc.

For a full list of options, run the `rspec` command with the `--help` flag:

```ruby
$ rspec --help
```

### Run with `ruby`

Generally, life is simpler if you just use the `rspec` command. If you must use
the `ruby` command, however, you'll need to require `rspec/autorun`. You can
either pass a `-rrspec/autorun` CLI option when invoking `ruby`, or add a
`require 'rspec/autorun'` to one or more of your spec files.

It is conventional to put configuration in and require assorted support files
from `spec/spec_helper.rb`. It is also conventional to require that file from
the spec files using `require 'spec_helper'`. This works because RSpec
implicitly adds the `spec` directory to the `LOAD_PATH`. It also adds `lib`, so
your implementation files will be on the `LOAD_PATH` as well.

If you're using the `ruby` command, you'll need to do this yourself (with the
`-I` option). Putting these together, your command might be something like this:

```ruby
$ ruby -Ilib -Ispec -rrspec/autorun path/to/spec.rb
```