Class: Rutema::Reporters::Collector
- Inherits:
-
EventReporter
- Object
- EventReporter
- Rutema::Reporters::Collector
- Defined in:
- lib/rutema/core/reporter.rb
Overview
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
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#states ⇒ Object
readonly
Returns the value of attribute states.
Instance Method Summary collapse
-
#initialize(params, dispatcher) ⇒ Collector
constructor
A new instance of Collector.
- #update(message) ⇒ Object
Methods inherited from EventReporter
Constructor Details
#initialize(params, dispatcher) ⇒ Collector
79 80 81 82 83 |
# File 'lib/rutema/core/reporter.rb', line 79 def initialize(params, dispatcher) super @errors = [] @states = {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
77 78 79 |
# File 'lib/rutema/core/reporter.rb', line 77 def errors @errors end |
#states ⇒ Object (readonly)
Returns the value of attribute states.
77 78 79 |
# File 'lib/rutema/core/reporter.rb', line 77 def states @states end |
Instance Method Details
#update(message) ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/rutema/core/reporter.rb', line 85 def update() case when RunnerMessage test_state = @states[.test] if test_state test_state << else test_state = Rutema::ReportState.new() end @states[.test] = test_state when ErrorMessage @errors << end end |