Class: FluQ::Handler::Test
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Attributes inherited from Base
Instance Method Summary collapse
- #filter(events) ⇒ Object
-
#initialize ⇒ Test
constructor
A new instance of Test.
- #on_events(events) ⇒ Object
Methods inherited from Base
Methods included from Mixins::Loggable
Constructor Details
#initialize ⇒ Test
Returns a new instance of Test.
18 19 20 21 |
# File 'lib/fluq/testing.rb', line 18 def initialize(*) super @events = [] end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
16 17 18 |
# File 'lib/fluq/testing.rb', line 16 def events @events end |
Instance Method Details
#filter(events) ⇒ Object
23 24 25 |
# File 'lib/fluq/testing.rb', line 23 def filter(events) events.reject {|e| e.key?("filter") } end |
#on_events(events) ⇒ Object
27 28 29 30 |
# File 'lib/fluq/testing.rb', line 27 def on_events(events) raise RuntimeError, "Test Failure!" if events.any? {|e| e.key?("error") } @events.concat events end |