diff --git a/lib/fugit/cron.rb b/lib/fugit/cron.rb index 952201d..abcae6a 100644 --- a/lib/fugit/cron.rb +++ b/lib/fugit/cron.rb @@ -485,6 +485,8 @@ def expand(min, max, r) sla = nil if sla == 1 # don't get fooled by /1 + edn = max if sla && edn.nil? + return [ nil ] if sta.nil? && edn.nil? && sla.nil? return [ sta ] if sta && edn.nil? diff --git a/spec/cron_spec.rb b/spec/cron_spec.rb index 1d065b0..fbd66c3 100644 --- a/spec/cron_spec.rb +++ b/spec/cron_spec.rb @@ -117,6 +117,10 @@ [ '59 18 * * 2#2', '2021-02-09 18:59:00', '2021-02-09 17:41:10' ], [ '59 18 * * 2#2', '2021-02-09 18:59:00', '2021-02-09 17:41:10', 'UTC' ], #[ '59 18 * * 2#1', '2021-02-09 18:59:00', '2021-02-09 17:41:10', 'utc' ], + + [ '15/30 * * * *', '2021-02-09 19:15:00', '2021-02-09 19:00:00' ], + [ '15/30 * * * *', '2021-02-09 19:45:00', '2021-02-09 19:30:00' ], + [ '15-40/30 * * * *', '2021-02-09 20:15:00', '2021-02-09 19:30:00' ], ] describe '#next_time' do