Logo: Relish

  1. Sign in

Project: RSpec Core 3.0

`--fail-fast` option

Use the --fail-fast option to tell RSpec to stop running the test suite on
the first failed test.

You may also specify --no-fail-fast to turn it off (default behaviour).

Background
Given
a file named "fail_fast_spec.rb" with:
RSpec.describe "fail fast" do
  it "passing test" do; end
  it "failing test" do
    fail
  end
  it "this should not be run" do; end
end
Scenarios
Using `--fail-fast`
When
I run rspec . --fail-fast
Then
the output should contain ".F"
Then
the output should not contain ".F."
Using `--no-fail-fast`
When
I run rspec . --no-fail-fast
Then
the output should contain ".F."

Last published almost 4 years ago by myronmarston.