occurs_between? weird behavior #88

Closed
myth17 opened this Issue Jul 1, 2012 · 1 comment

Comments

Projects
None yet
2 participants

myth17 commented Jul 1, 2012

This a test I wrote :

   it 'should return true if a recurring schedule occurs_between? a time range' do
      start_time=Time.new(2012,7,7,8)
      schedule = IceCube::Schedule.new(start_time, :duration => 2*IceCube::ONE_HOUR, :end_time=>start_time+2*IceCube::ONE_HOUR+5*IceCube::ONE_WEEK)
      schedule.add_recurrence_rule Rule.weekly
      t1=Time.new(2012,7,14,9)
      t2=Time.new(2012,7,14,11)
      conflict=schedule.occurs_between?(t1,t2)
      conflict.should be_true
   end

Why does the test fail? Is this a bug?

Owner

seejohnrun commented Oct 12, 2012

occurs_between? only handles the times that events start, so this is the right behavior. If you wanted the behavior you describe here though, you can just add 2 hours to your t2.

I'll add a method occurring_between? with the desired functionality
Also will add a regression test for this issue to make sure its handled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment