Class: Downstream::HaveEnqueuedAsyncSubscriberFor::EventMatcher

Inherits:
Object
  • Object
show all
Includes:
RSpec::Matchers::Composable
Defined in:
lib/downstream/rspec/have_enqueued_async_subscriber_for.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ EventMatcher

Returns a new instance of EventMatcher.



12
13
14
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 12

def initialize(event)
  @event = event
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



10
11
12
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 10

def event
  @event
end

Instance Method Details

#descriptionObject



20
21
22
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 20

def description
  "be #{event.inspect}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 16

def matches?(actual)
  actual == event
end