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, #print, #puts

Methods inherited from Reporter

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

Constructor Details

#initialize(writer = STDOUT) ⇒ DotMatrixReporter

Returns a new instance of DotMatrixReporter.



91
92
93
94
# File 'lib/riot/reporter.rb', line 91

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

Instance Method Details

#error(description, e) ⇒ Object



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

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

#fail(description, message) ⇒ Object



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

def fail(description, message)
  print yellow("F")
  @details << "FAILURE - #{current_context.description} #{description} => #{message}"
end

#pass(description, message) ⇒ Object



96
97
98
# File 'lib/riot/reporter.rb', line 96

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

#results(time_taken) ⇒ Object



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

def results(time_taken)
  puts "\n" unless @details.empty?
  @details.each { |detail| puts detail }
  super
end