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:
parent
c9b1579809
commit
7843815554
1 changed files with 36 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue