Object
Collects and reports the result of all runs.
Did this run pass?
# File lib/minitest.rb, line 413 def passed? results.all?(&:skipped?) end
# File lib/minitest/parallel_each.rb, line 101 def record result Reporter.synchronize do simple_record result end end
Outputs the summary of the run.
# File lib/minitest.rb, line 464 def report aggregate = results.group_by { |r| r.failure.class } aggregate.default = [] # dumb. group_by should provide this f = aggregate[Assertion].size e = aggregate[UnexpectedError].size s = aggregate[Skip].size t = Time.now - start_time io.puts # finish the dots io.puts io.puts "Finished in %.6fs, %.4f runs/s, %.4f assertions/s." % [t, count / t, self.assertions / t] format = "%d runs, %d assertions, %d failures, %d errors, %d skips" summary = format % [count, self.assertions, f, e, s] io.print self io.puts io.puts summary end
Top-level method to ensure that start and report are called. Yields to the caller.
# File lib/minitest.rb, line 421 def run_and_report start yield io.sync = self.old_sync if self.sync report end
Starts reporting on the run.
# File lib/minitest.rb, line 433 def start self.sync = io.respond_to? :"sync=" # stupid emacs self.old_sync, io.sync = io.sync, true if self.sync self.start_time = Time.now io.puts "Run options: #{options[:args]}" io.puts io.puts "# Running:" io.puts end
Generated with the Darkfish Rdoc Generator 2.