[macruby-changes] [2289] MacRuby/trunk/mspec/lib/mspec/runner

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 11 19:25:27 PDT 2009


Revision: 2289
          http://trac.macosforge.org/projects/ruby/changeset/2289
Author:   mattaimonetti at gmail.com
Date:     2009-08-11 19:25:26 -0700 (Tue, 11 Aug 2009)
Log Message:
-----------
fixed the summary report and only print out a dot when a spec file loads to avoid spec interferences

Modified Paths:
--------------
    MacRuby/trunk/mspec/lib/mspec/runner/actions/macruby_stats.rb
    MacRuby/trunk/mspec/lib/mspec/runner/formatters/macruby.rb

Modified: MacRuby/trunk/mspec/lib/mspec/runner/actions/macruby_stats.rb
===================================================================
--- MacRuby/trunk/mspec/lib/mspec/runner/actions/macruby_stats.rb	2009-08-12 00:21:08 UTC (rev 2288)
+++ MacRuby/trunk/mspec/lib/mspec/runner/actions/macruby_stats.rb	2009-08-12 02:25:26 UTC (rev 2289)
@@ -76,7 +76,8 @@
   def load
     @current_category = @stats.push_file(MSpec.retrieve(:file))
     skilled_specs = MSpec.read_tags(['critical', 'fails']).size
-    @stats.push_skipped(current_category, skilled_specs) if skilled_specs > 0
+    @stats.push_skipped(current_category, skilled_specs) if skilled_specs > 0 
+    print "."
   end
   
   def example(state, block)
@@ -84,7 +85,6 @@
   end
   
   def expectation(state)
-    print "."
     @stats.expectation!(current_category)
   end
   

Modified: MacRuby/trunk/mspec/lib/mspec/runner/formatters/macruby.rb
===================================================================
--- MacRuby/trunk/mspec/lib/mspec/runner/formatters/macruby.rb	2009-08-12 00:21:08 UTC (rev 2288)
+++ MacRuby/trunk/mspec/lib/mspec/runner/formatters/macruby.rb	2009-08-12 02:25:26 UTC (rev 2289)
@@ -27,6 +27,10 @@
     super
     (@stats = MacRubyStatsAction.new).register
   end
+  
+  def sum_skipped
+    @stats.categories.inject(0){|sum, cat_info| sum += cat_info.last[:skipped].to_i}
+  end
 
   def finish
     switch
@@ -40,12 +44,12 @@
     print "\nSummary:\n"
     print "files: ",        @tally.counter.files,        "\n"
     print "examples: ",     @tally.counter.examples,     "\n"
-    print "skipped examples: ", @stats.categories.inject(0){|sum, cat| sum += cat[:skipped]}, "\n"
+    print "skipped examples: ", sum_skipped, "\n"
     print "expectations: ", @tally.counter.expectations, "\n"
     print "failures: ",     @tally.counter.failures,     "\n"
     print "errors: ",       @tally.counter.errors,       "\n" 
     
-    print "\nExceptions:\n"
+    print "\nExceptions:\n" unless @exceptions.empty?
     count = 0
     @exceptions.each do |exc|
       outcome = exc.failure? ? "FAILED" : "ERROR"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090811/0ae1f512/attachment.html>


More information about the macruby-changes mailing list