<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -54,7 +54,7 @@ module AutotestNotification
   end
 
   Autotest.add_hook :ran_features do |at|
-    results = at.results.is_a?(Array) ? at.results.last(4): at.results.split(&quot;\n&quot;).last(4)
+    results = at.results.is_a?(Array) ? at.results : at.results.split(&quot;\n&quot;)
     if results
       # How many scenarios and steps have passed, are pending, have failed or are undefined?
       for result in results
@@ -64,18 +64,20 @@ module AutotestNotification
           instance_variable_set &quot;@#{scenario_or_step}_#{x}&quot;, result[/(\d+) #{x}/, 1].to_i
         end
       end
-      @scenario_failed += @scenario_undefined
-      @step_failed += @step_undefined
 
-      code = (@scenario_failed + @step_failed &gt; 0) ? 31 : (@scenario_pending + @step_pending &gt; 0) ? 33 : 32
-      msg = feature_message(@scenario_scenario, @scenario_pending, @scenario_failed, @step_step, @step_pending, @step_failed)
+      count = @scenario_scenario + @step_step
+      failed = @scenario_failed + @step_failed
+      pending = @scenario_pending + @step_pending + @scenario_undefined + @step_undefined
+
+      code = (failed &gt; 0) ? 31 : (pending &gt; 0) ? 33 : 32
+      msg = feature_message(@scenario_scenario, @scenario_pending + @scenario_undefined, @scenario_failed, @step_step, @step_pending + @step_undefined, @step_failed)
 
       if @scenario_failed + @step_failed &gt; 0
-        notify &quot;FAIL&quot;, msg, Config.fail_image, @scenario_scenario + @step_step, @scenario_failed + @step_failed, 2
-      elsif PENDING &amp;&amp; @scenario_pending + @step_pending &gt; 0
-        notify &quot;Pending&quot;, msg, Config.pending_image, @scenario_scenario + @step_step, @scenario_failed + @step_failed, 1
+        notify &quot;FAIL&quot;, msg, Config.fail_image, count, failed, 2
+      elsif PENDING &amp;&amp; pending &gt; 0
+        notify &quot;Pending&quot;, msg, Config.pending_image, count, failed, 1
       else
-        notify &quot;Pass&quot;, msg, Config.success_image, @scenario_scenario + @step_step, 0, -2
+        notify &quot;Pass&quot;, msg, Config.success_image, count, 0, -2
       end
       puts &quot;\e[#{code}m#{'=' * 80}\e[0m\n\n&quot;
     end</diff>
      <filename>lib/autotest_notification.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e241058de58b81587190446a05f4d336f40517c6</id>
    </parent>
  </parents>
  <author>
    <name>ernesto</name>
    <email>ernestonakamura@gmail.com</email>
  </author>
  <url>http://github.com/carlosbrando/autotest-notification/commit/0d028af2ab5f969677e68778d582c249f38ddd07</url>
  <id>0d028af2ab5f969677e68778d582c249f38ddd07</id>
  <committed-date>2009-09-30T20:29:15-07:00</committed-date>
  <authored-date>2009-09-30T17:01:54-07:00</authored-date>
  <message>Bug fixes in ran_features hook</message>
  <tree>d443f98f0ba0fe194537060d5950ed0e740198cc</tree>
  <committer>
    <name>Carlos Brando</name>
    <email>eduardobrando@gmail.com</email>
  </committer>
</commit>
