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
Constructor Details
#initialize(job) ⇒ EnqueuedJob
Returns a new instance of EnqueuedJob.
89 90 91 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 89 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
86 87 88 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 86 def job @job end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
105 106 107 108 109 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 105 def ==(other) super(other) unless other.is_a?(EnqueuedJob) jid == other.jid end |
#args ⇒ Object
97 98 99 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 97 def args @args ||= JobArguments.new(job).unwrapped_arguments end |
#context ⇒ Object
101 102 103 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 101 def context @context ||= job.except("args") end |
#jid ⇒ Object
93 94 95 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 93 def jid job["jid"] end |