Sha256: c5580954186d8ac49c9bfb0f03f46b9f1dae397e87c32aabe5dff0f772a540dd
Contents?: true
Size: 1.21 KB
Versions: 3
Compression:
Stored size: 1.21 KB
Contents
$:.unshift(File.dirname(__FILE__) + '/../lib') require 'test/unit' require 'icalendar' require 'date' class TestCalendar < Test::Unit::TestCase # Generate a calendar using the raw api, and then spit it out # as a string. Parse the string and make sure everything matches up. def test_raw_generation # Create a fresh calendar cal = Icalendar::Calendar.new cal.calscale = "GREGORIAN" cal.version = "3.2" cal.prodid = "test-prodid" # Now generate the string and then parse it so we can verify # that everything was set, generated and parsed correctly. calString = cal.to_ical cals = Icalendar::Parser.new(calString).parse cal2 = cals.first assert_equal("GREGORIAN", cal2.calscale) assert_equal("3.2", cal2.version) assert_equal("test-prodid", cal2.prodid) end def test_block_creation cal = Icalendar::Calendar.new cal.event do dtend "19970903T190000Z" summary "This is my summary" end event = cal.event event.dtend = "19970903T190000Z" event.summary = "This is my summary" ev = cal.events.each do |ev| assert_equal("19970903T190000Z", ev.dtend) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
icalendar-0.96.1 | test/calendar_test.rb |
icalendar-0.96.2 | test/calendar_test.rb |
icalendar-0.96 | test/calendar_test.rb |