Class: Riot::IOReporter

Inherits:
Reporter show all
Defined in:
lib/riot/reporter.rb

Overview

Reporter

Direct Known Subclasses

DotMatrixReporter, StoryReporter

Instance Attribute Summary

Attributes inherited from Reporter

#errors, #failures, #passes

Instance Method Summary collapse

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(message) @writer.puts(message); end