task_helper: ensure that incrementing above 100% doesn’t raise an error
This commit is contained in:
parent
2bb103b8bd
commit
60121a1be6
1 changed files with 16 additions and 0 deletions
16
spec/lib/tasks/task_helper_spec.rb
Normal file
16
spec/lib/tasks/task_helper_spec.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe ProgressReport, lib: true do
|
||||
context 'when the count pass above 100%' do
|
||||
let(:total) { 2 }
|
||||
|
||||
subject(:progress) { ProgressReport.new(total) }
|
||||
|
||||
it 'doesn’t raise errors' do
|
||||
expect do
|
||||
(total + 2).times { progress.inc }
|
||||
progress.finish
|
||||
end.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue