rossta / montrose

Recurring events library for Ruby. Enumerable recurrence objects and convenient chainable interface.
https://rossta.net/montrose/
MIT License
842 stars 52 forks source link

added failing include? specs for weekly recurrences with intervals #132

Closed adipasquale closed 3 years ago

adipasquale commented 3 years ago

Hi @rossta ! First of all, thanks for the lib, we use it extensively in our product đź‘Ť I'm continuing @mmagn work whom already asked you a few questions here.

In this PR, I've only added 2 failing specs, and I'd be willing to try and fix them if you confirm that they are problematic (and not that I misunderstood how to use montrose).

Both relate to calling include? on weekly reccurences with intervals != 1.

  1. The first failing spec I added is at the frequency level : if I set a specific weekday like on: [:wednesday] it seems to be ignored by the include? call (in total I added 3 spec cases in the weekly frequency spec file, but only one fails, the one with the wednesday day)

  2. The second is the one that I care most about. I test at the Recurrence level with every: :week, interval: 2 options. The interval seems to be ignored in the include? calls.

Thank you

rossta commented 3 years ago

@adipasquale Thank you for the bug report and the failing tests! Much appreciated.

These do appear to be bugs with #include?. If you're interested in pursuing a fix, that would be most welcome!

rossta commented 3 years ago

On closer inspection, issue (1) is as designed; "weekly" and "day of week" are separate rules—when used together as part of a recurrence, it would behave as you'd expect.

I've addressed issue (2) in #137

adipasquale commented 3 years ago

@rossta thank you very much for digging into this issue 🙇 sorry I did not take the time to do it before.