Skip to content

Commit

Permalink
Add test: normal error without cause, fix typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenk committed Apr 8, 2015
1 parent 60b7c95 commit 4fa9fa8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/test_retry.rb
Expand Up @@ -329,6 +329,22 @@ def @redis.multi; yield self; end
end
end

describe 'handles errors withouth cause' do
before do
@error = nil
begin
raise ::StandardError, 'Error'
rescue ::StandardError => e
@error = e
end
end

it "does not recurse infinitely checking if it's a shutdown" do
assert(!Sidekiq::Middleware::Server::RetryJobs.new.send(
:exception_caused_by_shutdown?, @error))
end
end

describe 'handles errors with circular causes' do
before do
@error = nil
Expand All @@ -347,7 +363,7 @@ def @redis.multi; yield self; end
end
end

it "does not recurse infinitely checking if it's a shudtown" do
it "does not recurse infinitely checking if it's a shutdown" do
assert(!Sidekiq::Middleware::Server::RetryJobs.new.send(
:exception_caused_by_shutdown?, @error))
end
Expand Down

0 comments on commit 4fa9fa8

Please sign in to comment.