Class: RSpec::Sidekiq::Matchers::JobMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/sidekiq/matchers/have_enqueued_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ JobMatcher

Returns a new instance of JobMatcher.



41
42
43
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 41

def initialize(klass)
  @jobs = unwrap_jobs(klass.jobs)
end

Instance Attribute Details

#jobsObject (readonly)

Returns the value of attribute jobs.



39
40
41
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 39

def jobs
  @jobs
end

Instance Method Details

#present?(arguments, options) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/rspec/sidekiq/matchers/have_enqueued_job.rb', line 45

def present?(arguments, options)
  !!find_job(arguments, options)
end