task_helper: ensure that incrementing above 100% doesn’t raise an error

This commit is contained in:
Pierre de La Morinerie 2019-05-29 11:49:11 +02:00
parent 2bb103b8bd
commit 60121a1be6

View 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 'doesnt raise errors' do
expect do
(total + 2).times { progress.inc }
progress.finish
end.not_to raise_error
end
end
end