Class: FluQ::Handler::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/fluq/testing.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#config, #name, #pattern, #reactor

Instance Method Summary collapse

Methods inherited from Base

#match?, #select, type

Methods included from Mixins::Loggable

#logger

Constructor Details

#initializeTest

Returns a new instance of Test.



28
29
30
31
# File 'lib/fluq/testing.rb', line 28

def initialize(*)
  super
  @events = []
end

Instance Attribute Details

#eventsObject (readonly)

Returns the value of attribute events.



26
27
28
# File 'lib/fluq/testing.rb', line 26

def events
  @events
end

Instance Method Details

#on_events(events) ⇒ Object

Raises:

  • (RuntimeError)


33
34
35
36
# File 'lib/fluq/testing.rb', line 33

def on_events(events)
  raise RuntimeError, "Test Failure!" if events.any? {|e| e.tag == "error.event" }
  @events.concat events
end