Class: Riot::IOReporter
Overview
Reporter
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Reporter
Instance Method Summary collapse
-
#initialize(writer = nil) ⇒ IOReporter
constructor
A new instance of IOReporter.
- #results(time_taken) ⇒ Object
- #say(message) ⇒ Object
Methods inherited from Reporter
#describe_context, #report, #summarize
Constructor Details
#initialize(writer = nil) ⇒ IOReporter
Returns a new instance of IOReporter.
34 35 36 37 |
# File 'lib/riot/reporter.rb', line 34 def initialize(writer=nil) super() @writer = writer || STDOUT end |
Instance Method Details
#results(time_taken) ⇒ Object
40 41 42 43 |
# File 'lib/riot/reporter.rb', line 40 def results(time_taken) values = [@passes, @failures, @errors, ("%0.6f" % time_taken)] say "\n%d passes, %d failures, %d errors in %s seconds" % values end |
#say(message) ⇒ Object
38 |
# File 'lib/riot/reporter.rb', line 38 def say() @writer.puts(); end |