File: fail_fast.feature

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 (44 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (6)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Feature: `--fail-fast` option

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

  You may add a parameter to tell RSpec to stop running the test suite after N
  failed tests, for example: `--fail-fast=3`.

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

  Background:
    Given a file named "fail_fast_spec.rb" with:
      """ruby
      RSpec.describe "fail fast" do
        it "passing test" do; end
        it "1st failing test" do
          fail
        end
        it "2nd failing test" do
          fail
        end
        it "3rd failing test" do
          fail
        end
        it "4th failing test" do
          fail
        end
        it "passing test" do; end
      end
      """

  Scenario: Using `--fail-fast`
    When I run `rspec . --fail-fast`
    Then the output should contain ".F"
    Then the output should not contain ".F."

  Scenario: Using `--fail-fast=3`
    When I run `rspec . --fail-fast=3`
    Then the output should contain ".FFF"
    Then the output should not contain ".FFFF."

  Scenario: Using `--no-fail-fast`
    When I run `rspec . --no-fail-fast`
    Then the output should contain ".FFFF."