@@ -102,7 +102,7 @@ module IceCube
102102 RRULE:FREQ=WEEKLY;BYDAY=TH;UNTIL=20130531T100000Z
103103 ICAL
104104
105- ical_string_woth_multiple_exdates = <<-ICAL . gsub ( /^\s */ , '' )
105+ ical_string_with_multiple_exdates = <<-ICAL . gsub ( /^\s */ , '' )
106106 DTSTART;TZID=America/Denver:20130731T143000
107107 DTEND;TZID=America/Denver:20130731T153000
108108 RRULE:FREQ=WEEKLY;UNTIL=20140730T203000Z;BYDAY=MO,WE,FR
@@ -111,6 +111,11 @@ module IceCube
111111 EXDATE;TZID=America/Denver:20130807T143000
112112 ICAL
113113
114+ ical_string_with_multiple_rules = <<-ICAL . gsub ( /^\s */ , '' )
115+ DTSTART;TZID=CDT:20151005T195541
116+ RRULE:FREQ=WEEKLY;BYDAY=MO,TU
117+ RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU;BYDAY=FR
118+ ICAL
114119
115120 def sorted_ical ( ical )
116121 ical . split ( /\n / ) . sort . map { |field |
@@ -359,10 +364,17 @@ def sorted_ical(ical)
359364 end
360365
361366 it 'handles multiple EXDATE lines' do
362- schedule = IceCube ::Schedule . from_ical ical_string_woth_multiple_exdates
367+ schedule = IceCube ::Schedule . from_ical ical_string_with_multiple_exdates
363368 schedule . exception_times . count . should == 3
364369 end
365370 end
371+
372+ describe 'multiple rules' do
373+ it 'handles multiple recurrence rules' do
374+ schedule = IceCube ::Schedule . from_ical ical_string_with_multiple_rules
375+ schedule . recurrence_rules . count . should == 2
376+ end
377+ end
366378 end
367379
368380end
0 commit comments