Class: RSpec::SidekiqPro::Matchers::HaveEnqueuedSidekiqJobs

Inherits:
Object
  • Object
show all
Includes:
JobMatcher
Defined in:
lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb

Instance Attribute Summary

Attributes included from JobMatcher

#actual_jobs, #expected_arguments, #expected_batch, #expected_count, #expected_interval, #expected_least_count, #expected_less_count, #expected_more_count, #expected_most_count, #expected_schedule, #expected_timestamp, #expected_without_batch, #worker_class

Instance Method Summary collapse

Methods included from JobMatcher

#actual_jobs_details_in_failure_message, #actual_jobs_size_in_failure_message, #at, #at_least, #at_most, #batch_match?, #exactly, #expectations_in_failure_message, #expected_interval_output, #expected_job_description, #failure_message_diff, #filter_jobs, #in, #job_details_in_failure_message, #less_than, #more_than, #normalize_arguments, #once, #output_arguments, #output_batch, #output_schedule, #times, #twice, #with, #within_batch, #without_batch

Instance Method Details

#descriptionObject



29
30
31
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 29

def description
  "have enqueued #{expected_job_description}"
end

#does_not_match?(worker_class) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 24

def does_not_match?(worker_class)
  @worker_class = worker_class
  super(worker_class.jobs)
end

#failure_messageObject



33
34
35
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 33

def failure_message
  "expected to have enqueued #{worker_class} job\n#{failure_message_diff}"
end

#failure_message_when_negatedObject



37
38
39
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 37

def failure_message_when_negated
  "expected not to have enqueued #{worker_class} job\n#{failure_message_diff}"
end

#matches?(worker_class) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 19

def matches?(worker_class)
  @worker_class = worker_class
  super(worker_class.jobs)
end

#supports_block_expectations?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 11

def supports_block_expectations?
  false
end

#supports_value_expectations?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/rspec/sidekiq_pro/matchers/have_enqueued_sidekiq_jobs.rb', line 15

def supports_value_expectations?
  true
end