<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/spec/runner/formatter/story/progress_bar_formatter.rb</filename>
    </added>
    <added>
      <filename>spec/spec/runner/formatter/story/progress_bar_formatter_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -104,7 +104,14 @@ module Spec
           end
           
           def run_ended
-            @output.puts &quot;#@count scenarios: #@successful_scenario_count succeeded, #{@failed_scenarios.size} failed, #@pending_scenario_count pending&quot;
+            summary_text = &quot;#@count scenarios: #@successful_scenario_count succeeded, #{@failed_scenarios.size} failed, #@pending_scenario_count pending&quot;
+            if !@failed_scenarios.empty?
+              @output.puts red(summary_text)
+            elsif !@pending_steps.empty?
+              @output.puts yellow(summary_text)
+            else
+              @output.puts green(summary_text)
+            end
             unless @pending_steps.empty?
               @output.puts &quot;\nPending Steps:&quot;
               @pending_steps.each_with_index do |pending, i|
@@ -116,11 +123,10 @@ module Spec
               @output.print &quot;\nFAILURES:&quot;
               @failed_scenarios.each_with_index do |failure, i|
                 title, scenario_name, err = failure
-                @output.print %[
-    #{i+1}) #{title} (#{scenario_name}) FAILED
-    #{err.class}: #{err.message}
-    #{err.backtrace.join(&quot;\n&quot;)}
-]
+                @output.print &quot;\n    #{i+1}) &quot;
+                @output.print red(&quot;#{title} (#{scenario_name}) FAILED&quot;)
+                @output.print red(&quot;\n    #{err.class}: #{err.message}&quot;)
+                @output.print &quot;\n    #{err.backtrace.join(&quot;\n&quot;)}\n&quot;
               end
             end            
           end</diff>
      <filename>lib/spec/runner/formatter/story/plain_text_formatter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -54,6 +54,7 @@ module Spec
                                                     &quot;Builtin formats for stories: &quot;,
                                                     &quot;plain|p              : Plain Text&quot;,
                                                     &quot;html|h               : A nice HTML report&quot;,
+                                                    &quot;progress|r           : Text progress&quot;,
                                                     &quot; &quot;,
                                                     &quot;FORMAT can also be the name of a custom formatter class&quot;,
                                                     &quot;(in which case you should also specify --require to load it)&quot;],</diff>
      <filename>lib/spec/runner/option_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,10 +24,13 @@ module Spec
       }
 
       STORY_FORMATTERS = {
-        'plain' =&gt; ['spec/runner/formatter/story/plain_text_formatter', 'Formatter::Story::PlainTextFormatter'],
-            'p' =&gt; ['spec/runner/formatter/story/plain_text_formatter', 'Formatter::Story::PlainTextFormatter'],
-         'html' =&gt; ['spec/runner/formatter/story/html_formatter',       'Formatter::Story::HtmlFormatter'],
-            'h' =&gt; ['spec/runner/formatter/story/html_formatter',       'Formatter::Story::HtmlFormatter']
+        'plain' =&gt; ['spec/runner/formatter/story/plain_text_formatter',   'Formatter::Story::PlainTextFormatter'],
+            'p' =&gt; ['spec/runner/formatter/story/plain_text_formatter',   'Formatter::Story::PlainTextFormatter'],
+         'html' =&gt; ['spec/runner/formatter/story/html_formatter',         'Formatter::Story::HtmlFormatter'],
+            'h' =&gt; ['spec/runner/formatter/story/html_formatter',         'Formatter::Story::HtmlFormatter'],
+     'progress' =&gt; ['spec/runner/formatter/story/progress_bar_formatter', 'Formatter::Story::ProgressBarFormatter'],
+            'r' =&gt; ['spec/runner/formatter/story/progress_bar_formatter', 'Formatter::Story::ProgressBarFormatter']
+            
       }
 
       attr_accessor(</diff>
      <filename>lib/spec/runner/options.rb</filename>
    </modified>
    <modified>
      <diff>@@ -159,6 +159,45 @@ module Spec
             @out.string.should include(&quot;3 scenarios: 1 succeeded, 1 failed, 1 pending&quot;)
           end
 
+          it 'should show test summary in red if there were failed scenarios' do
+            # when
+            @out.stub!(:tty?).and_return(true)
+            @options.stub!(:colour).and_return(true)
+
+            @formatter.scenario_started(nil, nil)
+            @formatter.scenario_failed('story', 'scenario', exception_from { raise RuntimeError, 'oops' })
+            @formatter.run_ended
+
+            # then
+            @out.string.should include(&quot;\e[31m scenarios: 0 succeeded, 1 failed, 0 pending\e[0m&quot;)
+          end
+
+          it 'should show test summary in yellow if there are pending scenarios' do
+            # when
+            @out.stub!(:tty?).and_return(true)
+            @options.stub!(:colour).and_return(true)
+
+            @formatter.scenario_started(nil, nil)
+            @formatter.scenario_pending('story', 'scenario', '')
+            @formatter.run_ended
+
+            # then
+            @out.string.should include(&quot;\e[32m scenarios: 0 succeeded, 0 failed, 1 pending\e[0m&quot;)
+          end
+
+          it 'should show test summary in green if all scenarios pass' do
+            # when
+            @out.stub!(:tty?).and_return(true)
+            @options.stub!(:colour).and_return(true)
+
+            @formatter.scenario_started(nil, nil)
+            @formatter.scenario_succeeded('story', 'scenario')
+            @formatter.run_ended
+
+            # then
+            @out.string.should include(&quot;\e[32m scenarios: 1 succeeded, 0 failed, 0 pending\e[0m&quot;)
+          end
+        
           it 'should produce details of the first failure each failed scenario when the run ends' do
             # when
             @formatter.run_started(3)
@@ -180,6 +219,19 @@ module Spec
             @out.string.should include(&quot;RuntimeError: oops3&quot;)
           end
 
+          it 'should produce details of the failures in red when the run ends' do
+            # when
+            @out.stub!(:tty?).and_return(true)
+            @options.stub!(:colour).and_return(true)
+            @formatter.scenario_started(nil, nil)
+            @formatter.scenario_failed('story', 'scenario1', exception_from { raise RuntimeError, 'oops1' })
+            @formatter.run_ended
+
+            # then
+            @out.string.should =~ /\e\[31m[\n\s]*story \(scenario1\) FAILED\e\[0m/m
+            @out.string.should =~ /\e\[31m[\n\s]*RuntimeError: oops1\e\[0m/m
+          end
+
           it 'should produce details of each pending step when the run ends' do
             # when
             @formatter.run_started(2)</diff>
      <filename>spec/spec/runner/formatter/story/plain_text_formatter_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5fd78361039d069449f91dc506ae2bf3d9d616de</id>
    </parent>
  </parents>
  <author>
    <name>Joseph Wilk</name>
    <email>josephwilk@joesniff.co.uk</email>
  </author>
  <url>http://github.com/dchelimsky/rspec/commit/59128a36e46becf3045ffe6ab4a32bb10f0ab8e9</url>
  <id>59128a36e46becf3045ffe6ab4a32bb10f0ab8e9</id>
  <committed-date>2008-08-05T02:17:56-07:00</committed-date>
  <authored-date>2008-07-24T04:21:12-07:00</authored-date>
  <message>story progress bar formatter and more colourful summaries from the plain text story formatter</message>
  <tree>3bd4b3830123c60db5dc04db4100f60382dbb47b</tree>
  <committer>
    <name>David Chelimsky</name>
    <email>dchelimsky@gmail.com</email>
  </committer>
</commit>
