Sha256: c01df006b09444a74b485342171c16ce7d7785a3220436e14b4458fb2eedaae9

Contents?: true

Size: 1.75 KB

Versions: 158

Compression:

Stored size: 1.75 KB

Contents

Feature: fail fast

  Use the fail_fast option to tell RSpec to abort the run on first failure:

      RSpec.configure {|c| c.fail_fast = true}

  Background:
    Given a file named "spec/spec_helper.rb" with:
      """
      RSpec.configure {|c| c.fail_fast = true}
      """

  Scenario: fail_fast with no failures (runs all examples)
    Given a file named "spec/example_spec.rb" with:
      """
      describe "something" do
        it "passes" do
        end

        it "passes too" do
        end
      end
      """
    When I run `rspec spec/example_spec.rb`
    Then the examples should all pass

  Scenario: fail_fast with first example failing (only runs the one example)
    Given a file named "spec/example_spec.rb" with:
      """
      require "spec_helper"
      describe "something" do
        it "fails" do
          fail
        end

        it "passes" do
        end
      end
      """
    When I run `rspec spec/example_spec.rb -fd`
    Then the output should contain "1 example, 1 failure"

  Scenario: fail_fast with multiple files, second example failing (only runs the first two examples)
    Given a file named "spec/example_1_spec.rb" with:
      """
      require "spec_helper"
      describe "something" do
        it "passes" do
        end

        it "fails" do
          fail
        end
      end

      describe "something else" do
        it "fails" do
          fail
        end
      end
      """
    And a file named "spec/example_2_spec.rb" with:
      """
      require "spec_helper"
      describe "something" do
        it "passes" do
        end
      end

      describe "something else" do
        it "fails" do
          fail
        end
      end
      """
    When I run `rspec spec`
    Then the output should contain "2 examples, 1 failure"

Version data entries

158 entries across 103 versions & 14 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.7.5 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.4 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.3 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
tnargav-1.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.11.1/features/configuration/fail_fast.feature
tnargav-1.2.3 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.11.1/features/configuration/fail_fast.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.7.2 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.1 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.7.0 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-core-2.10.1/features/configuration/fail_fast.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.6.9 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature
classiccms-0.6.8 vendor/bundle/gems/rspec-core-2.9.0/features/configuration/fail_fast.feature
classiccms-0.6.7 vendor/bundle/gems/rspec-core-2.10.0/features/configuration/fail_fast.feature