spec/job_spec.rb in rufus-scheduler-3.1.5 vs spec/job_spec.rb in rufus-scheduler-3.1.6

- old
+ new

@@ -625,7 +625,37 @@ expect(job.mean_work_time).to be > 0.05 expect(job.mean_work_time).to be < 0.06 end end end + + context 'one time job' do + + describe '#determine_id' do + + it 'returns unique ids' do + + ids = [] + + 10_000.times { ids << @scheduler.in('1y') {} } + + expect(ids.uniq.length).to eq(ids.length) + end + end + end + + context 'repeat job' do + + describe '#determine_id' do + + it 'returns unique ids' do + + ids = [] + + 10_000.times { ids << @scheduler.every('1y') {} } + + expect(ids.uniq.length).to eq(ids.length) + end + end + end end