Skip to content

Commit

Permalink
Add spec for gh-76, initially tuned for post gh-47
Browse files Browse the repository at this point in the history
jmettraux committed Sep 14, 2022

Verified

This commit was signed with the committer’s verified signature.
mkllnk Maikel
1 parent 42ca309 commit 1cb4aa7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/cron_spec.rb
Original file line number Diff line number Diff line change
@@ -757,6 +757,21 @@ class Fugit::Cron::TimeCursor
expect(cron0.next_time('2021-04-21 07:00:00').to_s
).to eq(cron1.next_time('2021-04-21 07:00:00').to_s)
end

it 'does not break on "30 14 * * 4%4+3" (gh-76)' do

t0 =
Time.utc(2022, 9, 12, 12, 1, 1, 0)
nt =
Fugit::Cron.do_parse('30 14 * * 4%4+3 Australia/Melbourne')
.next_time(t0)

expect(nt.to_s).to eq('2022-10-06 03:30:00 Z') # post gh-47
#
in_zone('Australia/Melbourne') do
expect(nt.to_t.to_s).to eq('2022-10-06 14:30:00 +1100')
end
end
end
end

0 comments on commit 1cb4aa7

Please sign in to comment.