1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Add tests for invalid concurrency and timeout setting (#4550)

This commit is contained in:
Manoj M J 2020-05-04 22:21:32 +05:30 committed by GitHub
parent c9b1579809
commit 7843815554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,6 +265,42 @@ describe Sidekiq::CLI do
end
end
end
describe 'when concurrency is not valid' do
describe 'when set to 0' do
it 'raises argument error' do
assert_raises(ArgumentError) do
subject.parse(%w[sidekiq -r ./test/fake_env.rb -c 0])
end
end
end
describe 'when set to a negative number' do
it 'raises argument error' do
assert_raises(ArgumentError) do
subject.parse(%w[sidekiq -r ./test/fake_env.rb -c -2])
end
end
end
end
describe 'when timeout is not valid' do
describe 'when set to 0' do
it 'raises argument error' do
assert_raises(ArgumentError) do
subject.parse(%w[sidekiq -r ./test/fake_env.rb -t 0])
end
end
end
describe 'when set to a negative number' do
it 'raises argument error' do
assert_raises(ArgumentError) do
subject.parse(%w[sidekiq -r ./test/fake_env.rb -t -2])
end
end
end
end
end
end