Permalink
Browse files

Add cuke scenario when another at_exit hook is added later after rspe…

…c's.
  • Loading branch information...
1 parent dc290d3 commit 021d831878aca6a659d0082b525a29f4e5bbc387 @dblock dblock committed with dchelimsky Aug 22, 2011
Showing with 17 additions and 1 deletion.
  1. +17 −1 features/command_line/exit_status.feature
@@ -42,11 +42,27 @@ Feature: exit status
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"
+
+ 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.