Class: Quarry::Reporter::Verbatim

Inherits:
Quarry::Reporter show all
Defined in:
lib/quarry/reporter/verbatim.rb

Overview

Verbatim Reporter

Constant Summary

Constants inherited from Quarry::Reporter

ANSICode

Instance Attribute Summary

Attributes inherited from Quarry::Reporter

#error, #fail, #pass, #steps

Instance Method Summary collapse

Methods inherited from Quarry::Reporter

#initialize, #report_end, #report_intro, #report_start, #report_step, #report_summary

Constructor Details

This class inherits a constructor from Quarry::Reporter

Instance Method Details

#report_comment(step) ⇒ Object



29
30
31
32
# File 'lib/quarry/reporter/verbatim.rb', line 29

def report_comment(step)
  puts step
  #puts
end

#report_error(step, error) ⇒ Object



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

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

#report_fail(step, error) ⇒ Object



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

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

#report_header(step) ⇒ Object

def report_step(step)

super
if step.code
  #str = "(%s) %s" % [count.join('.'), str.tab(6).strip]
  #puts "* #{step.to_s.tab(2).strip}"
  #puts
  #puts step.to_s
  #puts
else
  #puts "#{step}\n"  # TODO: This never happens.
end

end



24
25
26
27
# File 'lib/quarry/reporter/verbatim.rb', line 24

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

#report_macro(step) ⇒ Object



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

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

#report_pass(step) ⇒ Object



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

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

#report_step_end(step) ⇒ Object



72
73
74
# File 'lib/quarry/reporter/verbatim.rb', line 72

def report_step_end(step)
  puts
end