Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ if (( cores > 8 )); then

export PARALLEL_TEST_PROCESSORS=8
fi

PATH_add bin
13 changes: 8 additions & 5 deletions spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,15 @@ CC in a background process and then forks it every time you run tests. That
means that everything loaded prior to the fork doesn't need to be re-loaded
every time you run tests. This can speed up tests substantially.

To use spring, run `./bin/rspec` in place of `rspec`. Spring should
automatically watch and reload files, but you can manually stop it with
`./bin/spring stop`. It will automatically start again the next time you run
`./bin/rspec`.
To use Spring, run `./bin/rspec` in place of the default `rspec` binary. CC's
`.envrc` adds the `./bin`` directory to your PATH, so in most cases you can
just run `rspec`. Spring will automatically watch and reload files, but you can
manually stop it with `spring stop`. It will automatically start again
the next time you run `rspec`.

Example performance improvement:
```sh
❯ multitime -n 10 bundle exec rspec spec/unit/actions/app_create_spec.rb
❯ multitime -n 10 bundle exec /path/to/default/rspec spec/unit/actions/app_create_spec.rb

...

Expand All @@ -160,6 +161,8 @@ user 0.177 0.032 0.129 0.185 0.233
sys 0.103 0.014 0.078 0.107 0.126
```

If you do not want to use Spring, you can set the `DISABLE_SPRING` environment variable.

#### Spork (Legacy)

Spork is an older implementation of the same "forking" strategy implemented by Spring.
Expand Down