Class: QED::Reporter::DTrace

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

Overview

Deep trace 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



59
60
61
62
# File 'lib/qed/reporter/dtrace.rb', line 59

def after_session(session)
  print_time
  print_tally
end

#before_session(session) ⇒ Object



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

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

#error(step, exception) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/qed/reporter/dtrace.rb', line 43

def error(step, exception)
  super(step, exception)

  io.puts "#{exception}".ansi(:red)

  backtrace = sane_backtrace(exception)
  backtrace.each do |bt|
    io.puts bt
    io.puts code_snippet(bt)
  end

  io.puts
end

#fail(step, assertion) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/qed/reporter/dtrace.rb', line 28

def fail(step, assertion)
  super(step, assertion)

  io.puts "#{assertion}".ansi(:red)

  backtrace = sane_backtrace(assertion)
  backtrace.each do |bt|
    io.puts bt
    io.puts code_snippet(bt)
  end

  io.puts
end

#pass(step) ⇒ Object

def before_step(step)

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

end



23
24
25
# File 'lib/qed/reporter/dtrace.rb', line 23

def pass(step)
  super(step)
end