Sha256: 4bf7de073b84f00fe5936ffa8c6f37bd79297e79cd5676f7f33340ef553a7229

Contents?: true

Size: 906 Bytes

Versions: 5

Compression:

Stored size: 906 Bytes

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))

require 'test/unit'
require 'icalendar'

# Define a test event
testEvent = <<EOS
BEGIN:VEVENT
UID:19970901T130000Z-123401@host.com
DTSTAMP:19970901T1300Z
DTSTART:19970903T163000Z
DTEND:19970903T190000Z
SUMMARY:Annual Employee Review
CLASS:PRIVATE
CATEGORIES:BUSINESS,HUMAN RESOURCES
END:VEVENT
EOS

class TestEvent < Test::Unit::TestCase

  # Create a calendar with an event for each test.
  def setup
    @cal = Icalendar::Calendar.new
    @event = Icalendar::Event.new
  end

  def test_new
    assert(@event)
  end
  
  # Properties that can only occur once per event
  def test_single_properties
    @event.ip_class = "PRIVATE"
    
    @cal.add_event(@event)
    
    cals = Icalendar::Parser.new(@cal.to_ical).parse
    cal2 = cals.first
    event2 = cal2.events.first
    
    assert_equal("PRIVATE", event2.ip_class)
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
icalendar-1.0 test/component/event_test.rb
icalendar-0.97 test/component/event_test.rb
icalendar-0.98 test/component/event_test.rb
icalendar-1.0.1 test/component/event_test.rb
icalendar-1.0.2 test/component/event_test.rb