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.
95 96 97 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 95 def initialize(job) @job = job end |
Instance Attribute Details
#job ⇒ Object (readonly)
Returns the value of attribute job.
92 93 94 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 92 def job @job end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
111 112 113 114 115 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 111 def ==(other) super(other) unless other.is_a?(EnqueuedJob) jid == other.jid end |
#args ⇒ Object
103 104 105 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 103 def args @args ||= JobArguments.new(job).unwrapped_arguments end |
#context ⇒ Object
107 108 109 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 107 def context @context ||= job.except("args") end |
#jid ⇒ Object
99 100 101 |
# File 'lib/rspec/sidekiq/matchers/base.rb', line 99 def jid job["jid"] end |