Module: Sidekiq::Worker::ClassMethods
- Defined in:
- lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb
Instance Method Summary collapse
- #default_retries_exhausted_exception ⇒ Object
- #default_retries_exhausted_message ⇒ Object
- #within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_retries_exhausted_exception, &block) ⇒ Object
Instance Method Details
#default_retries_exhausted_exception ⇒ Object
24 25 26 |
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 24 def default_retries_exhausted_exception StandardError.new('An error occurred') end |
#default_retries_exhausted_message ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 15 def { 'queue' => ['queue'], 'class' => name, 'args' => [], 'error_message' => 'An error occurred' } end |
#within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_retries_exhausted_exception, &block) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb', line 6 def within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_retries_exhausted_exception, &block) unless sidekiq_retries_exhausted_block raise ArgumentError, 'Define `sidekiq_retries_exhausted` before calling `within_sidekiq_retries_exhausted_block`' end block.call sidekiq_retries_exhausted_block.call(.merge(user_msg), exception) end |