class Rutema::Reporters::Collector

This reporter is always instantiated and collects all messages fired by the rutema engine

The collections of errors and states are then at the end of a run fed to the block reporters

Attributes

errors[R]
states[R]

Public Class Methods

new(params,dispatcher) click to toggle source
Calls superclass method Rutema::Reporters::EventReporter::new
# File lib/rutema/core/reporter.rb, line 59
def initialize params,dispatcher
  super(params,dispatcher)
  @errors=[]
  @states={}
end

Public Instance Methods

update(message) click to toggle source
# File lib/rutema/core/reporter.rb, line 65
def update message
  case message
  when RunnerMessage
    test_state=@states[message.test]
    if test_state
      test_state<<message
    else
      test_state=Rutema::ReportState.new(message)
    end
    @states[message.test]=test_state
  when ErrorMessage
    @errors<<message
  end
end