This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Expand file tree Collapse file tree 3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ Breaking Changes:
11
11
* Remove ` run_all_when_everything_filtered ` configuration option. (Phil Pirozhkov, #2845 )
12
12
* Raise on unsupported hook scope usage. (Phil Pirozhkov, #????)
13
13
* Raise on usage of metadata on suite-level scopes. (Phil Pirozhkov, #????)
14
+ * Raise an error when ` fail_fast ` is configured with
15
+ an unsupported value. (Phil Pirozhkov, #????)
14
16
15
17
Enhancements:
16
18
Original file line number Diff line number Diff line change @@ -203,8 +203,7 @@ def fail_fast=(value)
203
203
@fail_fast = value . to_i
204
204
205
205
if value . to_i == 0
206
- # TODO: in RSpec 4, consider raising an error here.
207
- RSpec . warning "Cannot set `RSpec.configuration.fail_fast`" \
206
+ raise ArgumentError , "Cannot set `RSpec.configuration.fail_fast`" \
208
207
" to `#{ value . inspect } `. Only `true`, `false`, `nil` and integers" \
209
208
" are valid values."
210
209
@fail_fast = true
Original file line number Diff line number Diff line change @@ -110,14 +110,10 @@ module RSpec::Core
110
110
allow ( RSpec ) . to receive ( :warning )
111
111
end
112
112
113
- it 'prints warning' do
114
- config . fail_fast = 'yes'
115
- expect ( RSpec ) . to have_received ( :warning ) . with ( /Cannot set `RSpec.configuration.fail_fast`/i )
116
- end
117
-
118
- it 'is set to true' do
119
- config . fail_fast = 'yes'
120
- expect ( config . fail_fast ) . to eq true
113
+ it 'raises an error' do
114
+ expect {
115
+ config . fail_fast = 'yes'
116
+ } . to raise_error ( ArgumentError , /Cannot set `RSpec.configuration.fail_fast`/i )
121
117
end
122
118
end
123
119
end
You can’t perform that action at this time.
0 commit comments