Class: QED::Reporter::Verbatim

Inherits:
BaseClass show all
Defined in:
lib/qed/reporter/verbatim.rb

Overview

Verbatim Reporter

Constant Summary

Constants inherited from BaseClass

BaseClass::ANSICode

Instance Attribute Summary

Attributes inherited from BaseClass

#error, #fail, #io, #pass, #steps

Instance Method Summary collapse

Methods inherited from BaseClass

#initialize, #report_end, #report_intro, #report_omit, #report_start, #report_step, #report_summary, #verbose?

Constructor Details

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

Instance Method Details

#report_comment(step) ⇒ Object



31
32
33
# File 'lib/qed/reporter/verbatim.rb', line 31

def report_comment(step)
  io.print step
end

#report_error(step, error) ⇒ Object



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/qed/reporter/verbatim.rb', line 58

def report_error(step, error)
  raise error if $DEBUG
  tab = step.to_s.index(/\S/) #step.tab
  io.print ANSICode.red("#{step}")
  msg = []
  msg << ANSICode.bold(ANSICode.red("ERROR: ")) + error.to_str.sub(/for QED::Context.*?$/,'')
  msg << ANSICode.bold(error.backtrace[0].chomp(":in \`_binding'"))
  #msg = ANSICode.red(msg)
  io.puts msg.join("\n").tabto(tab||2)
  io.puts
end

#report_fail(step, error) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/qed/reporter/verbatim.rb', line 48

def report_fail(step, error)
  tab = step.to_s.index(/\S/) #step.tab
  io.print ANSICode.red("#{step}")
  msg = []
  msg << ANSICode.bold(ANSICode.red("FAIL: ")) + error.to_str
  msg << ANSICode.bold(error.backtrace[0].chomp(":in \`_binding'"))
  io.puts msg.join("\n").tabto(tab||2)
  io.puts
end

#report_header(step) ⇒ Object

def report_intro

io.puts

end



27
28
29
# File 'lib/qed/reporter/verbatim.rb', line 27

def report_header(step)
  io.print ANSICode.bold("#{step}")
end

#report_macro(step) ⇒ Object



36
37
38
39
40
41
# File 'lib/qed/reporter/verbatim.rb', line 36

def report_macro(step)
  #io.puts
  #io.puts step.text
  io.print ANSICode.magenta("#{step}")
  #io.puts
end

#report_pass(step) ⇒ Object



44
45
46
# File 'lib/qed/reporter/verbatim.rb', line 44

def report_pass(step)
  io.print ANSICode.green("#{step}")
end

#report_step_end(step) ⇒ Object



70
71
72
# File 'lib/qed/reporter/verbatim.rb', line 70

def report_step_end(step)
  io.puts
end