Class: RSpec::Sidekiq::Matchers::JobOptionParser
- Inherits:
-
Object
- Object
- RSpec::Sidekiq::Matchers::JobOptionParser
- Defined in:
- lib/rspec/sidekiq/matchers/have_enqueued_job.rb
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
-
#initialize(job) ⇒ JobOptionParser
constructor
A new instance of JobOptionParser.
- #matches?(option, value) ⇒ Boolean
Constructor Details
#initialize(job) ⇒ JobOptionParser
Returns a new instance of JobOptionParser.
16 17 18 |
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 16 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
14 15 16 |
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 14 def job @job end |
Instance Method Details
#matches?(option, value) ⇒ Boolean
20 21 22 23 |
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 20 def matches?(option, value) raise ArgumentError, "Option `#{option}` is not defined." unless %w(in at).include?(option.to_s) send("#{option}_evaluator", value) end |