Skip to content

Commit

Permalink
Add cuke scenario when another at_exit hook is added later after rspe…
Browse files Browse the repository at this point in the history
…c's.
  • Loading branch information
dblock authored and dchelimsky committed Aug 22, 2011
1 parent dc290d3 commit 021d831
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion features/command_line/exit_status.feature
Expand Up @@ -42,11 +42,27 @@ Feature: exit status
When I run `rspec nested_ko_spec.rb` When I run `rspec nested_ko_spec.rb`
Then the exit status should be 1 Then the exit status should be 1
And the output should contain "1 example, 1 failure" And the output should contain "1 example, 1 failure"

Scenario: exit with 0 when no examples are run Scenario: exit with 0 when no examples are run
Given a file named "a_no_examples_spec.rb" with: Given a file named "a_no_examples_spec.rb" with:
""" """
""" """
When I run `rspec a_no_examples_spec.rb` When I run `rspec a_no_examples_spec.rb`
Then the exit status should be 0 Then the exit status should be 0
And the output should contain "0 examples" And the output should contain "0 examples"

Scenario: exit with 1 when an at_exit hook sets the exit code
Given a file named "exit_at_spec.rb" with:
"""
require 'rspec/autorun'
describe "exit_at" do
it "fails" do
at_exit { exit 0 }
1.should == 2
end
end
"""
When I run `rspec exit_at_spec.rb`
Then the exit status should be 1
And the output should contain "1 example, 1 failure"

0 comments on commit 021d831

Please sign in to comment.