Class: RSpec::Sidekiq::Matchers::EnqueuedJob

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/rspec/sidekiq/matchers/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#jobObject (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

#argsObject



103
104
105
# File 'lib/rspec/sidekiq/matchers/base.rb', line 103

def args
  @args ||= JobArguments.new(job).unwrapped_arguments
end

#contextObject



107
108
109
# File 'lib/rspec/sidekiq/matchers/base.rb', line 107

def context
  @context ||= job.except("args")
end

#jidObject



99
100
101
# File 'lib/rspec/sidekiq/matchers/base.rb', line 99

def jid
  job["jid"]
end