Class: Tengu::BaseFormatter
- Inherits:
-
Object
- Object
- Tengu::BaseFormatter
- Defined in:
- lib/tengu/base_formatter.rb
Instance Method Summary collapse
-
#initialize(out = $stdout) ⇒ BaseFormatter
constructor
A new instance of BaseFormatter.
- #notify(event, object = nil) ⇒ Object
Constructor Details
#initialize(out = $stdout) ⇒ BaseFormatter
Returns a new instance of BaseFormatter.
3 4 5 6 |
# File 'lib/tengu/base_formatter.rb', line 3 def initialize(out = $stdout) @out = out @failures = [] end |
Instance Method Details
#notify(event, object = nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tengu/base_formatter.rb', line 8 def notify(event, object = nil) case event when :started then started(object) when :pending then out.print "P" when :success then out.print "." when :failure then @failures << object out.print "F" when :finished then finished(object) end end |