Class: Riot::DotMatrixReporter
Instance Attribute Summary
Attributes inherited from IOReporter
#writer
Attributes inherited from Reporter
#current_context, #errors, #failures, #passes
Instance Method Summary
collapse
Methods inherited from IOReporter
#format_error, #say
Methods inherited from Reporter
#describe_context, #new, #report, #summarize
Constructor Details
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
100
101
102
103
|
# File 'lib/riot/reporter.rb', line 100
def error(description, e)
writer.write red("E")
@details << "ERROR - #{current_context.description} #{description} => #{format_error(e)}"
end
|
#fail(description, message) ⇒ Object
95
96
97
98
|
# File 'lib/riot/reporter.rb', line 95
def fail(description, message)
writer.write yellow("F")
@details << "FAILURE - #{current_context.description} #{description} => #{message}"
end
|
#pass(description) ⇒ Object
89
|
# File 'lib/riot/reporter.rb', line 89
def pass(description); writer.write green("."); end
|
#results(time_taken) ⇒ Object
105
106
107
108
109
|
# File 'lib/riot/reporter.rb', line 105
def results(time_taken)
say "\n"
@details.each { |detail| say detail }
super
end
|