Class: ActiveEventStore::HaveEnqueuedAsyncSubscriberFor::EventMatcher
- Inherits:
-
Object
- Object
- ActiveEventStore::HaveEnqueuedAsyncSubscriberFor::EventMatcher
- Includes:
- RSpec::Matchers::Composable
- Defined in:
- lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(event) ⇒ EventMatcher
constructor
A new instance of EventMatcher.
- #matches?(actual_serialized) ⇒ Boolean
Constructor Details
#initialize(event) ⇒ EventMatcher
Returns a new instance of EventMatcher.
19 20 21 |
# File 'lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb', line 19 def initialize(event) @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
17 18 19 |
# File 'lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb', line 17 def event @event end |
Instance Method Details
#description ⇒ Object
[View source]
32 33 34 |
# File 'lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb', line 32 def description "be #{event.inspect}" end |
#matches?(actual_serialized) ⇒ Boolean
23 24 25 26 27 28 29 30 |
# File 'lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb', line 23 def matches?(actual_serialized) actual = ActiveEventStore.event_store.deserialize( **actual_serialized.symbolize_keys, serializer: ActiveEventStore.config.serializer ) actual.event_type == event.event_type && data_matches?(actual.data) end |