spec/job_every_spec.rb in rufus-scheduler-3.0.9 vs spec/job_every_spec.rb in rufus-scheduler-3.1.0

- old
+ new

@@ -47,9 +47,23 @@ expect(times[1] - times[0]).to be < 1.4 expect(times[2] - times[1]).to be > 3.0 expect(times[2] - times[1]).to be < 3.4 end + context 'summer time' do + + it 'triggers correctly through a DST transition' do + + job = Rufus::Scheduler::EveryJob.new(@scheduler, '1m', {}, lambda {}) + t1 = ltz('America/Los_Angeles', 2015, 3, 8, 1, 55) + t2 = ltz('America/Los_Angeles', 2015, 3, 8, 3, 05) + job.next_time = t1 + occurrences = job.occurrences(t1, t2) + + expect(occurrences.length).to eq(11) + end + end + context 'first_at/in' do it 'triggers for the first time at first_at' do t = Time.now