Class: QED::Reporter::DotProgress

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

Overview

DotProgress Reporter

Instance Attribute Summary

Attributes inherited from Abstract

#io, #record, #session

Instance Method Summary collapse

Methods inherited from Abstract

After, Before, When, #after_code, #after_data, #after_demo, #after_desc, #after_head, #after_step, #before_code, #before_data, #before_demo, #before_desc, #before_head, #before_step, #code, #count_code, #count_demo, #count_desc, #count_error, #count_fail, #count_pass, #data, #demo, #demos, #desc, #errors, #fails, #head, #import, #initialize, #load, #omits, #passes, #steps, #trace?, #unload, #update, #when

Constructor Details

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

Instance Method Details

#after_session(session) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/qed/reporter/dotprogress.rb', line 42

def after_session(session)
  print_time

  errors.each do |step, exception|
    backtrace = sane_backtrace(exception)

    io.puts "***** ERROR *****".ansi(:red)
    io.puts "#{exception}"
    backtrace.each do |bt|
      io.puts bt
      io.puts code_snippet(bt)
    end
    io.puts
  end

  fails.each do |step, assertion|
    backtrace = sane_backtrace(assertion)

    io.puts "***** FAIL *****".ansi(:red, :bold)
    io.puts "#{assertion}"
    backtrace.each do |bt|
      io.puts bt
      io.puts code_snippet(bt)
    end
    io.puts
  end

  print_tally
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

#error(step, exception) ⇒ Object



35
36
37
38
39
# File 'lib/qed/reporter/dotprogress.rb', line 35

def error(step, exception)
  io.print "E"
  io.flush
  super(step, exception)
end

#fail(step, assertion) ⇒ Object



29
30
31
32
33
# File 'lib/qed/reporter/dotprogress.rb', line 29

def fail(step, assertion)
  io.print "F"
  io.flush
  super(step, assertion)
end

#pass(step) ⇒ Object

def before_step(step)

super(step)
io.print "."
io.flush

end



23
24
25
26
27
# File 'lib/qed/reporter/dotprogress.rb', line 23

def pass(step)
  io.print "."
  io.flush
  super(step)
end