Class: Riot::DotMatrixReporter

Inherits:
IOReporter show all
Defined in:
lib/riot/reporter.rb

Instance Attribute Summary

Attributes inherited from Reporter

#current_context, #errors, #failures, #passes

Instance Method Summary collapse

Methods inherited from IOReporter

#format_error, #line_info, #print, #puts

Methods inherited from Reporter

#describe_context, #new, #report, #success?, #summarize

Constructor Details

#initialize(writer = STDOUT) ⇒ DotMatrixReporter

Returns a new instance of DotMatrixReporter.



104
105
106
107
# File 'lib/riot/reporter.rb', line 104

def initialize(writer=STDOUT)
  super
  @details = []
end

Instance Method Details

#error(description, e) ⇒ Object



118
119
120
121
# File 'lib/riot/reporter.rb', line 118

def error(description, e)
  print red("E")
  @details << "ERROR - #{test_detail(description, format_error(e))}"
end

#fail(description, message, line, file) ⇒ Object



113
114
115
116
# File 'lib/riot/reporter.rb', line 113

def fail(description, message, line, file)
  print yellow("F")
  @details << "FAILURE - #{test_detail(description, message)} #{line_info(line, file)}".strip
end

#pass(description, message) ⇒ Object



109
110
111
# File 'lib/riot/reporter.rb', line 109

def pass(description, message)
  print green(".")
end

#results(time_taken) ⇒ Object



123
124
125
126
# File 'lib/riot/reporter.rb', line 123

def results(time_taken)
  puts "\n#{@details.join("\n\n")}" unless @details.empty?
  super
end