Class: Riot::DotMatrixReporter
- Inherits:
-
IOReporter
- Object
- Reporter
- IOReporter
- Riot::DotMatrixReporter
- Defined in:
- lib/riot/reporter.rb
Instance Attribute Summary
Attributes inherited from Reporter
#current_context, #errors, #failures, #passes
Instance Method Summary collapse
- #error(description, e) ⇒ Object
- #fail(description, message, line, file) ⇒ Object
-
#initialize(writer = STDOUT) ⇒ DotMatrixReporter
constructor
A new instance of DotMatrixReporter.
- #pass(description, message) ⇒ Object
- #results(time_taken) ⇒ Object
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, , line, file) print yellow("F") @details << "FAILURE - #{test_detail(description, )} #{line_info(line, file)}".strip end |
#pass(description, message) ⇒ Object
125 126 127 |
# File 'lib/riot/reporter.rb', line 125 def pass(description, ) 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 |