Class: Quarry::Spec::Reporter::Verbatim

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

Overview

Verbatim Reporter

Constant Summary

Constants inherited from Quarry::Spec::Reporter

ANSICode

Instance Attribute Summary

Attributes inherited from Quarry::Spec::Reporter

#error, #fail, #pass, #steps

Instance Method Summary collapse

Methods inherited from Quarry::Spec::Reporter

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

Constructor Details

This class inherits a constructor from Quarry::Spec::Reporter

Instance Method Details

#report_comment(step) ⇒ Object



31
32
33
34
# File 'lib/quarry/spec/reporter/verbatim.rb', line 31

def report_comment(step)
  puts step.text
  puts
end

#report_error(step, exception) ⇒ Object



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

def report_error(step, exception)
  raise exception if $DEBUG
  msg = ''
  msg << "##### ERROR #####\n"
  msg << exception.to_s + "\n"
  msg << exception.backtrace[0]
  msg = ANSICode.magenta(msg)
  puts msg
  puts
  puts ANSICode.red("#{step.code}")
  puts
end

#report_fail(step, assertion) ⇒ Object



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

def report_fail(step, assertion)
  msg = ''
  msg << "##### FAIL #####\n"
  msg << assertion.to_s + "\n"
  msg << assertion.backtrace[2]
  msg = ANSICode.magenta(msg)
  puts msg
  puts
  puts ANSICode.red("#{step.code}")
  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.text.tab(2).strip}"
  #puts
  #puts step.text
  #puts
else
  #puts "#{step.text}\n"  # TODO: This never happens.
end

end



26
27
28
29
# File 'lib/quarry/spec/reporter/verbatim.rb', line 26

def report_header(step)
  puts ANSICode.bold(step.text)
  puts
end

#report_macro(step) ⇒ Object



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

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

#report_pass(step) ⇒ Object



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

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