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.



100
101
102
103
# File 'lib/riot/reporter.rb', line 100

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

Instance Method Details

#error(description, e) ⇒ Object



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

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

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



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

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



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

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

#results(time_taken) ⇒ Object



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

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