diff --git a/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb b/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb index 30e8eec..d27b41b 100644 --- a/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb +++ b/lib/rspec/sidekiq/helpers/within_sidekiq_retries_exhausted_block.rb @@ -10,15 +10,15 @@ def within_sidekiq_retries_exhausted_block(user_msg = {}, exception = default_re def default_retries_exhausted_message { - 'queue' => get_sidekiq_options[:worker], + 'queue' => get_sidekiq_options['queue'], 'class' => name, 'args' => [], - 'error_message' => 'An error occured' + 'error_message' => 'An error occurred' } end def default_retries_exhausted_exception - StandardError.new('An error occured') + StandardError.new('An error occurred') end end end diff --git a/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb b/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb index 7e4811d..26cc2dc 100644 --- a/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb +++ b/spec/rspec/sidekiq/helpers/retries_exhausted_spec.rb @@ -20,6 +20,15 @@ def self.baz(exception) end end + it 'has an exhausted message' do + expect(FooClass.default_retries_exhausted_message).to eq({ + "args" => [], + "class" => "FooClass", + "error_message" => "An error occurred", + "queue" => "data", + }) + end + it 'executes whatever is within the block' do FooClass.within_sidekiq_retries_exhausted_block { expect(FooClass).to receive(:bar).with('hello') } end