test/test_ical.rb in vpim-0.658 vs test/test_ical.rb in vpim-0.695

- old
+ new

@@ -7,10 +7,13 @@ # Sorry for the donkey patching... module Enumerable def first find{true} end + def last + inject{|memo, o| o} + end end include Vpim Req_1 =<<___ @@ -397,9 +400,28 @@ END:VCALENDAR __ assert_equal("TRANSPARENT", transparency, "check transparent") end + + def test_location + cal = Icalendar.decode(<<__).first +BEGIN:VCALENDAR +BEGIN:VEVENT +LOCATION:bien located +END:VEVENT +BEGIN:VTODO +LOCATION: +END:VTODO +BEGIN:VEVENT +END:VEVENT +END:VCALENDAR +__ + assert_equal(cal.events.first.location, "bien located") + assert_equal(cal.todos.first.location, "") + assert_equal(cal.events.last.location, nil) + end + def test_event_maker_w_rrule vc = Icalendar.create2 do |vc| vc.add_event do |m| m.add_rrule("freq=monthly")