Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Also run excluded examples when turning run_all_when_everything_filte…

…red on.
  • Loading branch information...
commit de5d5647890a3cdced1be1ecc31700c3e30767fe 1 parent 8ecae7d
@janv authored
Showing with 25 additions and 2 deletions.
  1. +3 −2 lib/rspec/core/world.rb
  2. +22 −0 spec/rspec/core/world_spec.rb
View
5 lib/rspec/core/world.rb
@@ -78,9 +78,10 @@ def announce_filters
end
if @configuration.run_all_when_everything_filtered? && example_count.zero?
- reporter.message("#{everything_filtered_message}; ignoring #{inclusion_filter.description}")
+ reporter.message("#{everything_filtered_message}; Running all.")
filtered_examples.clear
inclusion_filter.clear
+ exclusion_filter.clear
end
if example_count.zero?
@@ -90,7 +91,7 @@ def announce_filters
elsif exclusion_filter.empty_without_conditional_filters?
message = everything_filtered_message
if @configuration.run_all_when_everything_filtered?
- message << "; ignoring #{inclusion_filter.description}"
+ message << "; Running all."
end
reporter.message(message)
elsif inclusion_filter.empty?
View
22 spec/rspec/core/world_spec.rb
@@ -139,6 +139,28 @@ module RSpec::Core
end
end
end
+
+ context "with an exclustion filter and run_all_when_everything_filtered" do
+ let(:group) do
+ group = RSpec::Core::ExampleGroup.describe("group", :foo => 'bar') do
+ example("example") {}
+ end
+ group.stub!(:world){world}
+ group
+ end
+
+ before do
+ world.register(group)
+ configuration.filter_run_excluding :foo => 'bar'
+ configuration.run_all_when_everything_filtered = true
+ end
+
+ it "announces" do
+ world.announce_filters
+ world.example_count.should eq(1)
+ end
+ end
+
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.