seejohnrun/ice_cube — Issue #43: bug in occurs_at in combination with recurrence_dates
Author: bitboxer
Created: 2011-11-27 19:58:32+00:00
State: open

When adding dates using recurrence_dates, the occures_at returns a wrong value:

require 'ice_cube.rb'

s = IceCube::Schedule.new(Time.new(2011,10,1, 18, 25))
s.add_recurrence_date(Time.new(2011,12,3,15,0,0))
s.add_recurrence_date(Time.new(2011,12,3,10,0,0))
s.add_recurrence_date(Time.new(2011,12,4,10,0,0))

p s.next_occurrences(12)

p s.occurs_at?(Time.new(2011,12,3,15,0,0))

This is because the method find_occurrences that is called in the occurrences method does only filter the rules, not the recurrence dates.