Class: RSpec::Sidekiq::Matchers::EnqueuedJob
- Inherits:
-
Object
- Object
- RSpec::Sidekiq::Matchers::EnqueuedJob
- Extended by:
- Forwardable
- Defined in:
- lib/rspec/sidekiq/matchers/base.rb
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #args ⇒ Object
- #context ⇒ Object
-
#initialize(job) ⇒ EnqueuedJob
constructor
A new instance of EnqueuedJob.
- #jid ⇒ Object
- #matches_arguments?(expected_args) ⇒ Boolean
- #matches_options?(expected_options) ⇒ Boolean
Constructor Details
#initialize(job) ⇒ EnqueuedJob
Returns a new instance of EnqueuedJob.
147 148 149 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 147 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
144 145 146 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 144 def job @job end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
171 172 173 174 175 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 171 def ==(other) super(other) unless other.is_a?(EnqueuedJob) jid == other.jid end |
#args ⇒ Object
155 156 157 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 155 def args @args ||= JobArguments.new(job).unwrapped_arguments end |
#context ⇒ Object
159 160 161 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 159 def context @context ||= job.except("args") end |
#jid ⇒ Object
151 152 153 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 151 def jid job["jid"] end |
#matches_arguments?(expected_args) ⇒ Boolean
163 164 165 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 163 def matches_arguments?(expected_args) job_arguments.matches?(expected_args) end |
#matches_options?(expected_options) ⇒ Boolean
167 168 169 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 167 def () job_option_parser.matches?() end |