Skip to content

Commit 73fdfc7

Browse files
committed
Fix specs that were not iterating over expectations
1 parent 7e0f374 commit 73fdfc7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

spec/examples/monthly_rule_spec.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,20 @@ module IceCube
9898
}
9999

100100
it "should not skip a month when DST ends" do
101-
schedule.first(48).inject(nil) do |last_date, current_date|
102-
next current_date unless last_date
103-
expect(month_interval(current_date, last_date)).to eq(1)
101+
schedule.first(48).each_cons(2) do |t0, t1|
102+
expect(month_interval(t1, t0)).to eq(1)
104103
end
105104
end
106105

107106
it "should not change day when DST ends" do
108-
schedule.first(48).inject(nil) do |last_date, current_date|
109-
next current_date unless last_date
110-
expect(current_date.wday).to eq(wday)
107+
schedule.first(48).each do |date|
108+
expect(date.wday).to eq(wday)
111109
end
112110
end
113111

114112
it "should not change hour when DST ends" do
115-
schedule.first(48).inject(nil) do |last_date, current_date|
116-
next current_date unless last_date
117-
expect(current_date.hour).to eq(0)
113+
schedule.first(48).each do |time|
114+
expect(time.hour).to eq(0)
118115
end
119116
end
120117
end

0 commit comments

Comments
 (0)