class ActiveEventStore::HaveEnqueuedAsyncSubscriberFor::EventMatcher

Attributes

event[R]

Public Class Methods

new(event) click to toggle source
# File lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb, line 19
def initialize(event)
  @event = event
end

Public Instance Methods

description() click to toggle source
# File lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb, line 29
def description
  "be #{event.inspect}"
end
matches?(actual_serialized) click to toggle source
# 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)

  actual.event_type == event.event_type && data_matches?(actual.data)
end

Private Instance Methods

data_matches?(actual) click to toggle source
# File lib/active_event_store/rspec/have_enqueued_async_subscriber_for.rb, line 35
def data_matches?(actual)
  ::RSpec::Matchers::BuiltIn::Match.new(event.data).matches?(actual)
end