<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,6 +9,10 @@ Feature: Sample
     Given passing
     
   @in-progress
+  Scenario: undefined
+    Given undefined
+
+  @in-progress
   Scenario: pending
     Given pending
   </diff>
      <filename>examples/self_test/features/sample.feature</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ Feature: In-progress formatter
 
   Scenario: passing scenario tagged as in-progress
     When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress --tags @in-progress features/sample.feature:8
-    Then it should pass with
+    Then it should fail with
     &quot;&quot;&quot;
     .
     
@@ -21,7 +21,7 @@ Feature: In-progress formatter
   Scenario: failing scenario tagged as in-progress
     When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress --tags @in-progress features/sample.feature:4
 
-    Then it should fail with
+    Then it should pass with
     &quot;&quot;&quot;
     F
 
@@ -31,7 +31,7 @@ Feature: In-progress formatter
     &quot;&quot;&quot;
       
   Scenario: pending scenario tagged as in-progress
-    When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress --tags @in-progress features/sample.feature:12
+    When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress --tags @in-progress features/sample.feature:16
 
     Then it should pass with
     &quot;&quot;&quot;
@@ -41,11 +41,23 @@ Feature: In-progress formatter
     1 pending step
 
     &quot;&quot;&quot;
-      
+
+  Scenario: undefined scenario tagged as in-progress
+    When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress --tags @in-progress features/sample.feature:12
+
+    Then it should pass with
+    &quot;&quot;&quot;
+    U
+
+    1 scenario
+    1 undefined step
+
+    &quot;&quot;&quot;   
+
   Scenario: running no scenarios
     When I run cucumber --require ../../formatters/ --require features/step_definitions/ -n --format Cucumber::Formatter::InProgress
 
-    Then it should fail with
+    Then it should pass with
     &quot;&quot;&quot;
     
     </diff>
      <filename>features/in_progress.feature</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,10 @@
 module Cucumber
   module Formatter
     class InProgress &lt; Progress
-     
+      FAILURE_CODE = 1
+      SUCCESS_CODE = 0
+      
       FORMATS[:invalid_pass] = Proc.new{ |string| ::Term::ANSIColor.blue(string) }
-
       def initialize(step_mother, io, options)
         super(step_mother, io, options)
         @scenario_passed = true
@@ -39,16 +40,25 @@ module Cucumber
         end
         print_counts
 
-        #When we run 0 scenarios cucumber will pass.
-        #We cannot distinguish between a pass with scenarios and a pass with no scenarios.
-        #So we overide the exit status with fail when there are no scenarios.
-        if @feature_element_count == 0 
-          at_exit do
-            Kernel.exit(1)
-          end
+        if non_passing_steps_occured? || @feature_element_count == 0
+          override_exit_code(SUCCESS_CODE)
+        else
+          override_exit_code(FAILURE_CODE)
         end
-          
       end
+
+      def non_passing_steps_occured?
+        @step_mother.steps(:pending).any? ||
+        @step_mother.steps(:undefined).any? ||
+        @step_mother.steps(:failed).any?
+      end
+
+      def override_exit_code(status_code)
+        at_exit do
+          Kernel.exit(status_code)
+        end
+      end
+      
     end
   end
 end</diff>
      <filename>formatters/in_progress.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,16 +18,8 @@ namespace :features do
   end
 
   desc &quot;Run in-progress features&quot;
-  task :in_progress do
-    Cucumber::Rake::Task.new(:in_progress_internal) do |t|  
-      t.cucumber_opts = &quot;--require formatters/ --format Cucumber::Formatter::InProgress --strict --tags in-progress&quot;  
-    end
-    
-    begin
-      Rake::Task['in_progress_internal'].invoke
-      raise BuildFailure
-    rescue
-    end
+  Cucumber::Rake::Task.new(:in_progress) do |t|  
+    t.cucumber_opts = &quot;--require formatters/ --format Cucumber::Formatter::InProgress --tags in-progress&quot;  
   end
 end
 </diff>
      <filename>tasks/features.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b404f3739669224b77f4bb6b16e9cb99e613fde7</id>
    </parent>
  </parents>
  <author>
    <name>Joseph Wilk</name>
    <email>joe@josephwilk.net</email>
  </author>
  <url>http://github.com/josephwilk/cucumber_cocktails/commit/b2861ae25ec5caae95373b7e21ab303ddd24f353</url>
  <id>b2861ae25ec5caae95373b7e21ab303ddd24f353</id>
  <committed-date>2009-04-11T11:27:06-07:00</committed-date>
  <authored-date>2009-04-11T11:27:06-07:00</authored-date>
  <message>Push all status code overiding to the formatter. Simplify Rake tasks</message>
  <tree>aaa1fce47593b615fca83287a974f3f006c617ee</tree>
  <committer>
    <name>Joseph Wilk</name>
    <email>joe@josephwilk.net</email>
  </committer>
</commit>
