Skip to content

class Athena::EventDispatcher::Spec::TracableEventDispatcher
inherits Athena::EventDispatcher::EventDispatcher #

Test implementation of AED::EventDispatcherInterface that keeps track of the events that were dispatched.

class MyEvent < AED::Event; end

class OtherEvent < AED::Event; end

dispatcher = AED::Spec::TracableEventDispatcher.new

dispatcher.dispatch MyEvent.new
dispatcher.dispatch OtherEvent.new

dispatcher.emitted_events # => [MyEvent, OtherEvent]

Methods#

#dispatch(event : AED::Event) : Nil#

:inherit:

View source

#emitted_events : Array(AED::Event.class)#

Returns an array of each AED::Event.class that was dispatched via this dispatcher.

View source