Skip to content

Commit 26b129b

Browse files
committed
Corrected spec: occurrence_count does not error when not set
1 parent 5d9b32c commit 26b129b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spec/examples/ice_cube_spec.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,11 +605,18 @@
605605

606606
it 'should be able to remove a count validation from a rule' do
607607
rule = IceCube::Rule.daily.count(5)
608-
rule.count nil
609-
rule.to_hash.should_not have_key(:count)
608+
rule.occurrence_count.should == 5
609+
rule.count(nil)
610610
rule.occurrence_count.should be_nil
611611
end
612612

613+
it 'should be able to remove a count validation from a rule' do
614+
rule = IceCube::Rule.daily.count(5)
615+
rule.to_hash[:count].should == 5
616+
rule.count nil
617+
rule.to_hash[:count].should be_nil
618+
end
619+
613620
it 'should be able to remove an until validation from a rule' do
614621
rule = IceCube::Rule.daily.until(Time.now + IceCube::ONE_DAY)
615622
rule.to_hash[:until].should_not be_nil

0 commit comments

Comments
 (0)