Class: Riot::TextReport
Overview
NilReport
Instance Attribute Summary
Attributes inherited from Report
#bad_results, #errors, #failures, #passes, #time_taken
Instance Method Summary collapse
- #errored(error) ⇒ Object
- #failed(failure) ⇒ Object
-
#initialize(writer = nil) ⇒ TextReport
constructor
A new instance of TextReport.
- #passed ⇒ Object
- #results ⇒ Object
Methods inherited from Report
#assertions, #passed?, #process_assertion, #time
Constructor Details
#initialize(writer = nil) ⇒ TextReport
Returns a new instance of TextReport.
48 49 50 51 |
# File 'lib/riot/report.rb', line 48 def initialize(writer=nil) super() @writer ||= STDOUT end |
Instance Method Details
#errored(error) ⇒ Object
61 62 63 |
# File 'lib/riot/report.rb', line 61 def errored(error) super && @writer.print('E') end |
#failed(failure) ⇒ Object
57 58 59 |
# File 'lib/riot/report.rb', line 57 def failed(failure) super && @writer.print('F') end |
#passed ⇒ Object
53 54 55 |
# File 'lib/riot/report.rb', line 53 def passed super && @writer.print('.') end |
#results ⇒ Object
65 66 67 68 69 70 |
# File 'lib/riot/report.rb', line 65 def results @writer.puts "\n\n" print_bad_results format = "%d assertions, %d failures, %d errors in %s seconds" @writer.puts format % [assertions, failures, errors, ("%0.6f" % time_taken)] end |