Sha256: a5bfbfc66f401d3844af2123b52a481f9a58bcc737e00345ab5d7e93d02037ff

Contents?: true

Size: 934 Bytes

Versions: 48

Compression:

Stored size: 934 Bytes

Contents

Feature: failure exit code

  Use the feature_exit_code option to set a custom exit code when RSpec fails.

    RSpec.configure { |c| c.failure_exit_code = 42 }

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

  Scenario: a failing spec with the default exit code
    Given a file named "spec/example_spec.rb" with:
      """ruby
      describe "something" do
        it "fails" do
          fail
        end
      end
      """
    When I run `rspec spec/example_spec.rb`
    Then the exit status should be 1

  Scenario: a failing spec with a custom exit code
    Given a file named "spec/example_spec.rb" with:
      """ruby
      require 'spec_helper'
      describe "something" do
        it "fails" do
          fail
        end
      end
      """
    When I run `rspec spec/example_spec.rb`
    Then the exit status should be 42

Version data entries

48 entries across 48 versions & 12 rubygems

Version Path
vagrant-unbundled-2.2.7.0 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.9.5.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
vagrant-cloudstack-1.1.0 vendor/bundle/gems/rspec-core-2.14.8/features/configuration/failure_exit_code.feature
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/rspec-core-2.13.0/features/configuration/failure_exit_code.feature
rspec-core-2.99.2 features/configuration/failure_exit_code.feature
dxruby_rp5-0.0.4 spec/vendor/rspec-core-2.14.7/features/configuration/failure_exit_code.feature
rspec-core-2.99.1 features/configuration/failure_exit_code.feature
rspec-core-2.99.0 features/configuration/failure_exit_code.feature
rspec-core-2.99.0.rc1 features/configuration/failure_exit_code.feature
rspec-core-2.14.8 features/configuration/failure_exit_code.feature
rspec-core-3.0.0.beta2 features/configuration/failure_exit_code.feature
rspec-core-2.99.0.beta2 features/configuration/failure_exit_code.feature
mango-0.8.0 vendor/bundler/ruby/2.1.0/gems/rspec-core-2.14.7/features/configuration/failure_exit_code.feature
mango-0.7.1 vendor/bundler/ruby/2.0.0/gems/rspec-core-2.14.7/features/configuration/failure_exit_code.feature