Sha256: 5fd2c479d92e63bb23e8445685852729b334cd4aaa9c0295180f499a1e0654b8

Contents?: true

Size: 1.2 KB

Versions: 27

Compression:

Stored size: 1.2 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:
      """
      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:
      """
      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 "No examples were matched by {:focus=>true}, running all"
    And the output should contain "3 examples, 0 failures"
    And the output should contain:
      """
      group 1
        group 1 example 1
        group 1 example 2

      group 2
        group 2 example 1
      """

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.4.0 features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.1.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.1.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.1.0 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.3.1 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.3.0 features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.0.3 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.2.1 features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.0.2 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
vim-jar-0.0.1 bundler/ruby/1.8/gems/rspec-core-2.1.0/features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.2.0 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.1.0 features/filtering/run_all_when_everything_filtered.feature
rspec-core-2.0.1 features/filtering/run_all_when_everything_filtered.feature
gemrage-1.0.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature
gemrage-0.4.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature
gemrage-0.4.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature
gemrage-0.3.2 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature
gemrage-0.3.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature
gemrage-0.3.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/filtering/run_all_when_everything_filtered.feature