Sha256: ec87f94002c47ad6ed160e46fe609091711ceed44d14e320ce8ce1e0519c2476

Contents?: true

Size: 1.19 KB

Versions: 13

Compression:

Stored size: 1.19 KB

Contents

Feature: run all when everything filtered

  Use the `run_all_when_everything_filtered` configuration option to do just
  that.  This works well when paired with an inclusion filter like ":focus =>
  true", as it will run all the examples when none match the inclusion filter.

  Background:
    Given a file named "spec/spec_helper.rb" with:
      """ruby
      RSpec.configure do |c|
        c.filter_run :focus => true
        c.run_all_when_everything_filtered = true
      end
      """

  Scenario: no examples match filter (runs all examples)
    Given a file named "spec/sample_spec.rb" with:
      """ruby
      require "spec_helper"

      describe "group 1" do
        it "group 1 example 1" do
        end

        it "group 1 example 2" do
        end
      end

      describe "group 2" do
        it "group 2 example 1" do
        end
      end
      """
    When I run `rspec spec/sample_spec.rb --format doc`
    Then the output should contain "All examples were filtered out; ignoring {:focus=>true}"
    And the examples should all pass
    And the output should contain:
      """
      group 1
        group 1 example 1
        group 1 example 2

      group 2
        group 2 example 1
      """

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-core-2.13.0/features/filtering/run_all_when_everything_filtered.feature
sshp-0.0.2 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/filtering/run_all_when_everything_filtered.feature
sshp-0.0.1 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/filtering/run_all_when_everything_filtered.feature
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/filtering/run_all_when_everything_filtered.feature
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/rspec-core-2.13.1/features/filtering/run_all_when_everything_filtered.feature
vagrant-actionio-0.0.9 vendor/bundle/gems/rspec-core-2.13.0/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.13.1 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.13.0 features/filtering/run_all_when_everything_filtered.feature
remq-0.0.4 vendor/bundle/gems/rspec-core-2.12.2/features/filtering/run_all_when_everything_filtered.feature
remq-0.0.3 vendor/bundle/gems/rspec-core-2.12.2/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.12.2 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.12.1 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.12.0 features/filtering/run_all_when_everything_filtered.feature