-
Notifications
You must be signed in to change notification settings - Fork 133
Where are the Specs for the RFC 2445 recurrence rule examples?
rubyredrick edited this page Sep 13, 2010
·
1 revision
The README says “All examples of recurring events in RFC 2445 are handled. RSpec examples are provided for them.” I tried to find them with grep but failed. Where are they?
They are in spec/ri_cal/property_value/recurrence_rule_spec.rb.
That spec uses a custom RSpec macro called enumeration_spec which DRYs up the many spec examples considerably. Each use case in section 4.8.5.4 “Recurrence Rule” of RFC 2445 (pages 117-125) is covered by an invocation of this macro. The description ties the spec back to the page or pages of RFC 2445 where the example occurs.
Here’s how the first example from RFC 2445 which is on p 118 looks:
enumeration_spec( "Daily for 10 occurrences (RFC 2445 p 118)", "19970902T090000", "US-Eastern", "FREQ=DAILY;COUNT=10", [ "Sep 2, 1997 9:00 AM EDT", "Sep 3, 1997 9:00 AM EDT", "Sep 4, 1997 9:00 AM EDT", "Sep 5, 1997 9:00 AM EDT", "Sep 6, 1997 9:00 AM EDT", "Sep 7, 1997 9:00 AM EDT", "Sep 8, 1997 9:00 AM EDT", "Sep 9, 1997 9:00 AM EDT", "Sep 10, 1997 9:00 AM EDT", "Sep 11, 1997 9:00 AM EDT" ] )