/usr/share/doc/ruby-rspec-core/features/configuration/fail_fast.feature is in ruby-rspec-core 3.5.0c3e0m0s0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | Feature: fail fast
Use the `fail_fast` option to tell RSpec to abort the run after N failures:
Scenario: `fail_fast` with no failures (runs all examples)
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure {|c| c.fail_fast = 1}
"""
And a file named "spec/example_spec.rb" with:
"""ruby
RSpec.describe "something" do
it "passes" do
end
it "passes too" do
end
end
"""
When I run `rspec spec/example_spec.rb`
Then the examples should all pass
Scenario: `fail_fast` with first example failing (only runs the one example)
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure {|c| c.fail_fast = 1}
"""
And a file named "spec/example_spec.rb" with:
"""ruby
require "spec_helper"
RSpec.describe "something" do
it "fails" do
fail
end
it "passes" do
end
end
"""
When I run `rspec spec/example_spec.rb -fd`
Then the output should contain "1 example, 1 failure"
Scenario: `fail_fast` with multiple files, second example failing (only runs the first two examples)
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure {|c| c.fail_fast = 1}
"""
And a file named "spec/example_1_spec.rb" with:
"""ruby
require "spec_helper"
RSpec.describe "something" do
it "passes" do
end
it "fails" do
fail
end
end
RSpec.describe "something else" do
it "fails" do
fail
end
end
"""
And a file named "spec/example_2_spec.rb" with:
"""ruby
require "spec_helper"
RSpec.describe "something" do
it "passes" do
end
end
RSpec.describe "something else" do
it "fails" do
fail
end
end
"""
When I run `rspec spec`
Then the output should contain "2 examples, 1 failure"
Scenario: `fail_fast 2` with 1st and 3rd examples failing (only runs the first 3 examples)
Given a file named "spec/spec_helper.rb" with:
"""ruby
RSpec.configure {|c| c.fail_fast = 2}
"""
And a file named "spec/example_spec.rb" with:
"""ruby
require "spec_helper"
RSpec.describe "something" do
it "fails once" do
fail
end
it "passes once" do
end
it "fails twice" do
fail
end
it "passes" do
end
end
"""
When I run `rspec spec/example_spec.rb -fd`
Then the output should contain "3 examples, 2 failures"
|