Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add attr_accessor for 'until' in RRule #26

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/icalendar/rrule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def to_s
end
end

attr_accessor :until

def initialize(name, params, value, parser)
@value = value
frequency_match = value.match(/FREQ=(SECONDLY|MINUTELY|HOURLY|DAILY|WEEKLY|MONTHLY|YEARLY)/)
Expand Down
34 changes: 34 additions & 0 deletions test/component/test_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,40 @@ def test_dtstart_set_correctly

end

class TestRecurringEventWithUntil < Test::Unit::TestCase

def setup
src = <<EOS
BEGIN:VCALENDAR
METHOD:PUBLISH
CALSCALE:GREGORIAN
VERSION:2.0
BEGIN:VEVENT
UID:19970901T130000Z-123401@host.com
DTSTAMP:19970901T1300Z
DTSTART:19970902T090000Z
DTEND:19970902T100000Z
RRULE:FREQ=WEEKLY;UNTIL=20110629T065959Z
SUMMARY:Annual Employee Review
CLASS:PRIVATE
CATEGORIES:BUSINESS,HUMAN RESOURCES
END:VEVENT
END:VCALENDAR
EOS
@calendar = Icalendar.parse(src).first
@event = @calendar.events.first
end

def test_event_is_parsed
assert_not_nil(@event)
end

def test_event_rule_until_info
assert_equal("2011-06-29T06:59:59+00:00", @event.recurrence_rules[0].until.to_s)
end

end

class TestRecurringEventWithCount < Test::Unit::TestCase
# DTSTART;TZID=US-Eastern:19970902T090000
# RRULE:FREQ=DAILY;COUNT=10
Expand Down