Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 4ff9c43

Browse files
committed
Combine --fail-fast and --no-fail-fast in help output.
1 parent 5942002 commit 4ff9c43

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/rspec/core/option_parser.rb

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,8 @@ def parser(options)
5454
options[:order] = "rand:#{seed}"
5555
end
5656

57-
parser.on('--fail-fast', 'Abort the run on first failure.') do |_o|
58-
set_fail_fast(options)
59-
end
60-
61-
parser.on('--no-fail-fast', 'Do not abort the run on first failure.') do |_o|
62-
set_fail_fast(options, false)
57+
parser.on('--[no-]fail-fast', 'Abort the run on first failure.') do |value|
58+
set_fail_fast(options, value)
6359
end
6460

6561
parser.on('--failure-exit-code CODE', Integer,
@@ -165,7 +161,7 @@ def parser(options)
165161
parser.on("--next-failure", "Apply `--only-failures` and abort after one failure.",
166162
" (Equivalent to `--only-failures --fail-fast --order defined`)") do
167163
add_tag_filter(options, :inclusion_filter, :last_run_status, 'failed')
168-
set_fail_fast(options)
164+
set_fail_fast(options, true)
169165
set_order(options, "defined")
170166
end
171167

@@ -249,7 +245,7 @@ def add_tag_filter(options, filter_type, tag_name, value=true)
249245
(options[filter_type] ||= {})[tag_name] = value
250246
end
251247

252-
def set_fail_fast(options, value=true)
248+
def set_fail_fast(options, value)
253249
options[:fail_fast] = value
254250
end
255251

0 commit comments

Comments
 (0)