Sha256: de40c68c016c603f24bfb6da4d7350a1e4b3c9f0a9328ae698a790e120d2c872

Contents?: true

Size: 1.38 KB

Versions: 27

Compression:

Stored size: 1.38 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 stdout should contain "1 example, 0 failures"

  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 stdout 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 stdout 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 stdout should contain "0 examples, 0 failures"

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
gemrage-0.2.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/command_line/exit_status.feature
gemrage-0.1.2 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/command_line/exit_status.feature
gemrage-0.1.1 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/command_line/exit_status.feature
gemrage-0.1.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/command_line/exit_status.feature
gemrage-0.0.0 vendor/ruby/1.8/gems/rspec-core-2.0.0/features/command_line/exit_status.feature
rspec-core-2.0.0 features/command_line/exit_status.feature
rspec-core-2.0.0.rc features/command_line/exit_status.feature