Class: Quarry::Reporter::Summary

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

Overview

Summary Reporter

Similar to the Verbatim reporter, but does not display test code for passing tests.

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_step_end, #report_summary

Constructor Details

This class inherits a constructor from Quarry::Reporter

Instance Method Details

#report_comment(step) ⇒ Object



18
19
20
21
22
# File 'lib/quarry/reporter/summary.rb', line 18

def report_comment(step)
  txt = step.to_s.tabto(2)
  txt[0,1] = "*"
  puts txt 
end

#report_error(step, exception) ⇒ Object



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

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}")
end

#report_fail(step, assertion) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/quarry/reporter/summary.rb', line 36

def report_fail(step, assertion)
  msg = ''
  msg << "  ##### FAIL #####\n"
  msg << "  # " + assertion.to_s
  msg = ANSICode.magenta(msg)
  puts msg
  #puts
  puts ANSICode.red("#{step}")
end

#report_header(step) ⇒ Object



14
15
16
# File 'lib/quarry/reporter/summary.rb', line 14

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

#report_macro(step) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/quarry/reporter/summary.rb', line 24

def report_macro(step)
  txt = step.to_s.tabto(2)
  txt[0,1] = "*"
  puts txt 
  #puts
  #puts ANSICode.magenta("#{step}")
end

#report_pass(step) ⇒ Object



32
33
34
# File 'lib/quarry/reporter/summary.rb', line 32

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