Skip to content

Commit

Permalink
add more description
Browse files Browse the repository at this point in the history
  • Loading branch information
nurse committed Dec 3, 2015
1 parent 5607f05 commit c3f0479
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/perfect_sched_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@
end

context 'DST 2015' do
it 'can go through America/Los_Angeles transition' do
t0 = Time.new(2015, 3, 8, 1, 59, 59, -8*3600)
t1 = Time.new(2015, 3, 9, 2, 0, 0, -7*3600) # 2015-03-08T02:00:00 doesn't exist
it 'skips task on 8 Mar because 1:59:59 PDT -> 3:00:00 PST' do
t0 = Time.new(2015, 3, 7, 2, 0, 0, -8*3600)
# 2015-03-08T02:00:00 doesn't exist
t1 = Time.new(2015, 3, 9, 2, 0, 0, -7*3600)
ts = PerfectSched.next_time('* 2 * * *', t0.to_i, 'America/Los_Angeles')
expect(ts).to eq(t1.to_i)
end
it 'can go through America/Los_Angeles transition' do
it 'runs twice on Nov 11 because 1:59:59 PST -> 1:00:00 PDT' do
# 2015-11-01T01:00:00 exists twice
t0 = Time.new(2015, 11, 1, 1, 0, 0, -7*3600)
t1 = Time.new(2015, 11, 1, 1, 0, 0, -8*3600) # 2015-11-01T01:00:00 exists twice
t1 = Time.new(2015, 11, 1, 1, 0, 0, -8*3600)
ts = PerfectSched.next_time('0 1 * * *', t0.to_i, 'America/Los_Angeles')
expect(ts).to eq(t1.to_i)
end
Expand Down

0 comments on commit c3f0479

Please sign in to comment.