Class: Downstream::HaveEnqueuedAsyncSubscriberFor
- Inherits:
-
RSpec::Rails::Matchers::ActiveJob::HaveEnqueuedJob
- Object
- RSpec::Rails::Matchers::ActiveJob::HaveEnqueuedJob
- Downstream::HaveEnqueuedAsyncSubscriberFor
- Defined in:
- lib/downstream/rspec/have_enqueued_async_subscriber_for.rb
Defined Under Namespace
Classes: EventMatcher
Instance Attribute Summary collapse
-
#callable ⇒ Object
readonly
Returns the value of attribute callable.
Instance Method Summary collapse
-
#initialize(callable) ⇒ HaveEnqueuedAsyncSubscriberFor
constructor
A new instance of HaveEnqueuedAsyncSubscriberFor.
- #matches?(proc) ⇒ Boolean
- #with(event) ⇒ Object
Constructor Details
#initialize(callable) ⇒ HaveEnqueuedAsyncSubscriberFor
Returns a new instance of HaveEnqueuedAsyncSubscriberFor.
27 28 29 30 |
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 27 def initialize(callable) @callable = callable super(SubscriberJob) end |
Instance Attribute Details
#callable ⇒ Object (readonly)
Returns the value of attribute callable.
25 26 27 |
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 25 def callable @callable end |
Instance Method Details
#matches?(proc) ⇒ Boolean
36 37 38 39 |
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 36 def matches?(proc) raise ArgumentError, "have_enqueued_async_subscriber_for only supports block expectations" unless Proc === proc super end |
#with(event) ⇒ Object
32 33 34 |
# File 'lib/downstream/rspec/have_enqueued_async_subscriber_for.rb', line 32 def with(event) super(EventMatcher.new(event), callable.name) end |