Class: QED::Reporter::DotProgress

Inherits:
Abstract
  • Object
show all
Defined in:
lib/qed/reporter/dotprogress.rb

Overview

DotProgress Reporter

Instance Attribute Summary

Attributes inherited from Abstract

#io, #omit, #steps

Instance Method Summary collapse

Methods inherited from Abstract

After, Before, When, #after_code, #after_document, #before_document, #code, #error, #errors, #fail, #failures, #import, #initialize, #load, #pass, #passes, #text, #trace?, #unload, #update, #when

Constructor Details

This class inherits a constructor from QED::Reporter::Abstract

Instance Method Details

#after_session(session) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/qed/reporter/dotprogress.rb', line 24

def after_session(session)
  io.puts "\nFinished in #{Time.now - @start_time} seconds.\n\n"

  @error.each do |step, exception|
    backtrace = clean_backtrace(exception.backtrace[0])
    io.puts "***** ERROR *****".ansi(:red)
    io.puts "#{exception}"
    io.puts ":#{backtrace}:"
    #io.puts ":#{exception.backtrace[1]}:"
    #io.puts exception.backtrace[1..-1] if $VERBOSE
    io.puts
  end

  @fail.each do |step, assertion|
    backtrace = clean_backtrace(assertion.backtrace[0])
    io.puts "***** FAIL *****".ansi(:red)
    io.puts "#{assertion}".ansi(:bold)
    io.puts ":#{backtrace}:"
    #io.puts assertion if $VERBOSE
    io.puts
  end

  io.puts "%s demos, %s steps, %s failures, %s errors" % [@demos, @steps, @fail.size, @error.size] #, @pass.size ]
end

#before_code(step, file) ⇒ Object



17
18
19
20
21
# File 'lib/qed/reporter/dotprogress.rb', line 17

def before_code(step, file)
  super(step, file)
  io.print "."
  io.flush
end

#before_session(session) ⇒ Object



11
12
13
14
# File 'lib/qed/reporter/dotprogress.rb', line 11

def before_session(session)
  @start_time = Time.now
  io.puts "Started"
end