-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebased against master -- its been 4 years
- Loading branch information
Showing
6 changed files
with
38 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,5 @@ | |
/spec/reports/ | ||
/tmp/ | ||
|
||
# rubymine | ||
.idea | ||
|
||
# rspec failure tracking | ||
.rspec_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
require File.dirname(__FILE__) + '/../spec_helper' | ||
|
||
module IceCube | ||
|
||
describe MonthlyRule, 'BYSETPOS' do | ||
it 'should behave correctly' do | ||
schedule = IceCube::Schedule.from_ical "RRULE:FREQ=MONTHLY;COUNT=4;BYDAY=WE;BYSETPOS=4" | ||
schedule.start_time = Time.new(2015, 5, 28, 12, 0, 0) | ||
expect(schedule.occurrences_between(Time.new(2015, 01, 01), Time.new(2017, 01, 01))).to eq([ | ||
Time.new(2015,6,24,12,0,0), | ||
Time.new(2015,7,22,12,0,0), | ||
Time.new(2015,8,26,12,0,0), | ||
Time.new(2015,9,23,12,0,0) | ||
]) | ||
expect(schedule.occurrences_between(Time.new(2015, 01, 01), Time.new(2017, 01, 01))). | ||
to eq([ | ||
Time.new(2015,6,24,12,0,0), | ||
Time.new(2015,7,22,12,0,0), | ||
Time.new(2015,8,26,12,0,0), | ||
Time.new(2015,9,23,12,0,0) | ||
]) | ||
end | ||
|
||
end | ||
|
||
describe YearlyRule, 'BYSETPOS' do | ||
it 'should behave correctly' do | ||
schedule = IceCube::Schedule.from_ical "RRULE:FREQ=YEARLY;BYMONTH=7;BYDAY=SU,MO,TU,WE,TH,FR,SA;BYSETPOS=-1" | ||
schedule.start_time = Time.new(1966,7,5) | ||
expect(schedule.occurrences_between(Time.new(2015, 01, 01), Time.new(2017, 01, 01))).to eq([ | ||
Time.new(2015, 7, 31), | ||
Time.new(2016, 7, 31) | ||
]) | ||
expect(schedule.occurrences_between(Time.new(2015, 01, 01), Time.new(2017, 01, 01))). | ||
to eq([ | ||
Time.new(2015, 7, 31), | ||
Time.new(2016, 7, 31) | ||
]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters