lib/minitest.rb in spec-5.0.18 vs lib/minitest.rb in spec-5.0.19

- old
+ new

@@ -3,12 +3,12 @@ ## # :include: README.txt module Minitest - VERSION = '5.0.18' # :nodoc: - DATE = '2013-08-13' # :nodoc: + VERSION = '5.0.19' # :nodoc: + DATE = '2013-08-19' # :nodoc: @@installed_at_exit ||= false @@after_run = [] @extensions = [] @@ -146,12 +146,13 @@ files_to_trace = spec_opts.fetch(:trace, []); io = spec_opts.fetch(:io, $stdout) color = spec_opts.fetch(:color, "\e[32m") # ANSI.green default # target only existing readable files - files_to_trace.each { |f| targets.push(f) if File.exists?(f) && File - .readable?(f) } + files_to_trace.each do |f| + targets.push(File.expand_path(f)) if File.exists?(f) && File.readable?(f) + end return if targets.empty? set_trace_func(lambda do |event, file, line, id, binding, classname| return unless targets.include? file @@ -323,11 +324,13 @@ reset class ExitAfterFirstFail < RuntimeError; end def self.check_failures result, reporter - if !result.failures.empty? + # skip is not a failure. + true_fails = result.failures.reject { |obj| obj.class == Minitest::Skip } + if !true_fails.empty? begin reporter.reporters.each { |r| r.report } ensure raise ExitAfterFirstFail end @@ -649,11 +652,11 @@ def report # :nodoc: super io.sync = self.old_sync - io.puts # finish the dots + io.puts unless options[:verbose] # finish the dots io.puts io.puts statistics io.puts aggregated_results io.puts summary end @@ -670,11 +673,16 @@ "\n%3d) %s" % [i+1, result] end.join("\n") + "\n" end def summary # :nodoc: - "%d runs, %d assertions, %d failures, %d errors, %d skips" % - [count, assertions, failures, errors, skips] + extra = "" + + extra = "\n\nYou have skipped tests. Run with --verbose for details." if + results.any?(&:skipped?) unless options[:verbose] or ENV["MT_NO_SKIP_MSG"] + + "%d runs, %d assertions, %d failures, %d errors, %d skips%s" % + [count, assertions, failures, errors, skips, extra] end end ## # Dispatch to multiple reporters as one.