Sha256: 0d067da864d13b2eb10b957dee5c4f3916fde8e409cebd8584d74f804fa94f59

Contents?: true

Size: 1.35 KB

Versions: 8

Compression:

Stored size: 1.35 KB

Contents

Feature: exit status

  In order to fail the build when it should, the spec CLI exits with an
  appropriate exit status

  Scenario: exit with 0 when all examples pass
    Given a file named "ok_spec.rb" with:
      """
      describe "ok" do
        it "passes" do
        end
      end
      """
    When I run `rspec ok_spec.rb`
    Then the exit status should be 0
    And the examples should all pass

  Scenario: exit with 1 when one example fails
    Given a file named "ko_spec.rb" with:
      """
      describe "KO" do
        it "fails" do
          raise "KO"
        end
      end
      """
    When I run `rspec ko_spec.rb`
    Then the exit status should be 1
    And the output should contain "1 example, 1 failure"

  Scenario: exit with 1 when a nested examples fails
    Given a file named "nested_ko_spec.rb" with:
      """
      describe "KO" do
        describe "nested" do
          it "fails" do
            raise "KO"
          end
        end
      end
      """
    When I run `rspec nested_ko_spec.rb`
    Then the exit status should be 1
    And the output should contain "1 example, 1 failure"
      
  Scenario: exit with 0 when no examples are run
    Given a file named "a_no_examples_spec.rb" with:
      """
      """
    When I run `rspec a_no_examples_spec.rb`
    Then the exit status should be 0
    And the output should contain "0 examples"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rspec-core-2.6.4 features/command_line/exit_status.feature
rspec-core-2.6.3 features/command_line/exit_status.feature
rspec-core-2.6.3.beta1 features/command_line/exit_status.feature
rspec-core-2.6.2.rc features/command_line/exit_status.feature
rspec-core-2.6.0 features/command_line/exit_status.feature
rspec-core-2.6.0.rc6 features/command_line/exit_status.feature
rspec-core-2.6.0.rc4 features/command_line/exit_status.feature
rspec-core-2.6.0.rc2 features/command_line/exit_status.feature