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

Commit f3c07ba

Browse files
authored
Merge pull request #2845 from rspec/remove-run_all_when_everything_filtered
Remove `run_all_when_everything_filtered` configuration option
2 parents 3a61f10 + 322ae4b commit f3c07ba

File tree

9 files changed

+1
-157
lines changed

9 files changed

+1
-157
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Breaking Changes:
66
* Extract `should` syntax (including the non-monkey-patching one liner). (Phil Pirozhkov, #2803)
77
* Remove globally-exposed DSL (example and shared group methods
88
in the root scope and on Module). (Phil Pirozhkov, #2803)
9+
* Remove `run_all_when_everything_filtered` configuration option. (Phil Pirozhkov, #2845)
910

1011
Enhancements:
1112

features/.nav

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
- exclusion_filters.feature
3939
- if_and_unless.feature
4040
- filter_run_when_matching.feature
41-
- run_all_when_everything_filtered.feature
4241
- configuration:
4342
- read_options_from_file.feature
4443
- color.feature

features/configuration/run_all_when_everything_filtered.feature

Lines changed: 0 additions & 82 deletions
This file was deleted.

lib/rspec/core/bisect/fork_runner.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ def run_specs(run_descriptor)
111111
c.load_spec_files
112112
end
113113

114-
# `announce_filters` has the side effect of implementing the logic
115-
# that honors `config.run_all_when_everything_filtered` so we need
116-
# to call it here. When we remove `run_all_when_everything_filtered`
117-
# (slated for RSpec 4), we can remove this call to `announce_filters`.
118-
@runner.world.announce_filters
119-
120114
@runner.run_specs(@runner.world.ordered_example_groups)
121115
latest_run_results = formatter.results
122116

lib/rspec/core/configuration.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,6 @@ def exclude_pattern=(value)
302302
attr_writer :profile_examples
303303
define_predicate :profile_examples
304304

305-
# @macro add_setting
306-
# Run all examples if none match the configured filters
307-
# (default: `false`).
308-
# @deprecated Use {#filter_run_when_matching} instead for the specific
309-
# filters that you want to be ignored if none match.
310-
add_setting :run_all_when_everything_filtered
311-
312305
# @macro add_setting
313306
# Color to use to indicate success. Defaults to `:green` but can be set
314307
# to one of the following: `[:black, :white, :red, :green, :yellow,

lib/rspec/core/world.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ def announce_filters
175175
end
176176
end
177177

178-
if @configuration.run_all_when_everything_filtered? && example_count.zero? && !@configuration.only_failures?
179-
report_filter_message("#{everything_filtered_message}; ignoring #{inclusion_filter.description}")
180-
filtered_examples.clear
181-
inclusion_filter.clear
182-
end
183-
184178
return unless example_count.zero?
185179

186180
example_groups.clear

spec/integration/bisect_runners_spec.rb

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,6 @@ def with_runner(&block)
5050
end
5151
end
5252

53-
it 'honors `run_all_when_everything_filtered`' do
54-
write_file 'spec/a_spec.rb', "
55-
RSpec.configure do |c|
56-
c.filter_run :focus
57-
c.run_all_when_everything_filtered = true
58-
end
59-
60-
RSpec.describe 'A group' do
61-
it('passes') { expect(1).to eq 1 }
62-
it('fails') { expect(1).to eq 2 }
63-
end
64-
"
65-
66-
with_runner do |runner|
67-
expect(runner.original_results).to have_attributes(
68-
:all_example_ids => %w[ ./spec/a_spec.rb[1:1] ./spec/a_spec.rb[1:2] ],
69-
:failed_example_ids => %w[ ./spec/a_spec.rb[1:2] ]
70-
)
71-
end
72-
end
73-
7453
it 'raises BisectFailedError with all run output when it encounters an error loading spec files' do
7554
write_file 'spec/a_spec.rb', "
7655
puts 'stdout in a_spec'

spec/rspec/core/configuration_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,17 +1293,6 @@ def metadata_hash(*args)
12931293

12941294
end
12951295

1296-
describe "#run_all_when_everything_filtered?" do
1297-
it "defaults to false" do
1298-
expect(config.run_all_when_everything_filtered?).to be(false)
1299-
end
1300-
1301-
it "can be queried by predicate method" do
1302-
config.run_all_when_everything_filtered = true
1303-
expect(config.run_all_when_everything_filtered?).to be(true)
1304-
end
1305-
end
1306-
13071296
describe "#color_mode" do
13081297
context ":automatic" do
13091298
before do

spec/rspec/core/world_spec.rb

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -217,19 +217,6 @@ def preceding_declaration_line(line_num)
217217
context "when --only-failures is passed" do
218218
before { configuration.force(:only_failures => true) }
219219

220-
context "and all examples are filtered out" do
221-
before do
222-
configuration.filter_run_including :foo => 'bar'
223-
end
224-
225-
it 'will ignore run_all_when_everything_filtered' do
226-
configuration.run_all_when_everything_filtered = true
227-
expect(world.filtered_examples).to_not receive(:clear)
228-
expect(world.inclusion_filter).to_not receive(:clear)
229-
world.announce_filters
230-
end
231-
end
232-
233220
context "and `example_status_persistence_file_path` is not configured" do
234221
it 'aborts with a message explaining the config option must be set first' do
235222
configuration.example_status_persistence_file_path = nil
@@ -287,16 +274,6 @@ def preceding_declaration_line(line_num)
287274
end
288275
end
289276

290-
context "with an inclusion filter and run_all_when_everything_filtered" do
291-
it "announces" do
292-
allow(configuration).to receive(:run_all_when_everything_filtered?) { true }
293-
configuration.filter_run_including :foo => 'bar'
294-
expect(reporter).to receive(:message).
295-
with(/All examples were filtered out/)
296-
world.announce_filters
297-
end
298-
end
299-
300277
context "with an exclusion filter" do
301278
it "announces" do
302279
configuration.filter_run_excluding :foo => 'bar'

0 commit comments

Comments
 (0)