Module: Sidekiq::Worker::ClassMethods

Defined in:
lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb

Instance Method Summary collapse

Instance Method Details

#default_retries_exhausted_exceptionObject



18
19
20
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 18

def default_retries_exhausted_exception
  StandardError.new('An error occured')
end

#default_retries_exhausted_messageObject



9
10
11
12
13
14
15
16
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 9

def default_retries_exhausted_message
  {
    'queue' => get_sidekiq_options[:worker],
    'class' => name,
    'args' => [],
    'error_message' => 'An error occured'
  }
end

#within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_retries_exhausted_exception, &block) ⇒ Object



4
5
6
7
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 4

def within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_retries_exhausted_exception, &block)
  block.call
  sidekiq_retries_exhausted_block.call(default_retries_exhausted_message.merge(user_msg), exception)
end