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.



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

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

Instance Method Details

#error(description, e) ⇒ Object



134
135
136
137
# File 'lib/riot/reporter.rb', line 134

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

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



129
130
131
132
# File 'lib/riot/reporter.rb', line 129

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



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

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

#results(time_taken) ⇒ Object



139
140
141
142
# File 'lib/riot/reporter.rb', line 139

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