Note: This section assumes that you are using hspec-2.4.2
or later.
When running tests, it is possible to only run tests that have failed in a previous test run. This can help to:
Two options are required for this.
Instruct Hspec to write/read failure reports to/from a file:
echo --failure-report .hspec-failures >> ~/.hspec
Enable --rerun
:
echo --rerun >> ~/.hspec
In addition --rerun-all-on-success
is useful in this scenario:
echo --rerun-all-on-success >> ~/.hspec
You may want to have a look at the section on options for more details.