Skip to content

Commit d19d30e

Browse files
committed
Add failing spec
1 parent 742220c commit d19d30e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/examples/daily_rule_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ module IceCube
112112
])
113113
end
114114

115+
it "should set the first occurrance to the first valid time after schedule start" do
116+
schedule = Schedule.new(Time.local(2013, 3, 8, 10, 0, 0))
117+
schedule.add_recurrence_rule Rule.daily(1).hour_of_day(9)
118+
expect(schedule.first).to eq(Time.local(2013, 3, 9, 9, 0, 0))
119+
end
120+
121+
it "should set the first occurrance to the first valid time after schedule start with interval > 1" do
122+
schedule = Schedule.new(Time.local(2013, 3, 8, 10, 0, 0))
123+
schedule.add_recurrence_rule Rule.daily(4).hour_of_day(9)
124+
expect(schedule.first).to eq(Time.local(2013, 3, 9, 9, 0, 0))
125+
end
126+
115127
describe "day validation" do
116128
it "allows multiples of 7" do
117129
expect { IceCube::Rule.daily(21).day(2, 4) }.to_not raise_error

0 commit comments

Comments
 (0)