Skip to content

Commit d62c581

Browse files
epologeeJankees van Woezik
andcommitted
Spec that from_ical and to_ical can perform round trip conversion
Co-authored-by: Jankees van Woezik <[email protected]>
1 parent 2e866d6 commit d62c581

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/examples/from_ical_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,22 @@ def sorted_ical(ical)
377377
expect(t.zone).to eq "MDT"
378378
end
379379
end
380+
381+
it "round trips from and to ical with time zones" do
382+
original = <<-ICAL.gsub(/^\s*/, "").strip
383+
DTSTART;TZID=MDT:20130731T143000
384+
RRULE:FREQ=WEEKLY;UNTIL=20140730T203000Z;BYDAY=MO,WE,FR
385+
RDATE;TZID=MDT:20150812T143000
386+
RDATE;TZID=MDT:20150807T143000
387+
EXDATE;TZID=MDT:20130823T143000
388+
EXDATE;TZID=MDT:20130812T143000
389+
EXDATE;TZID=MDT:20130807T143000
390+
DTEND;TZID=MDT:20130731T153000
391+
ICAL
392+
393+
schedule_from_ical = IceCube::Schedule.from_ical original
394+
expect(schedule_from_ical.to_ical).to eq original
395+
end
380396
end
381397

382398
describe "exceptions" do

0 commit comments

Comments
 (0)