3 ms·
That's interesting because if I understand the bug correctly, it should have failed as soon as you performed the test less than 5 days before the end of the cur
by jobigoud 11y ago
That's interesting because if I understand the bug correctly, it should have failed as soon as you performed the test less than 5 days before the end of the current month. (Except in December and July for which the next month has the same number of days in it.).
- meesterdude 11y agoif i recall, it was a bug that would come and go from our tests depending on when you ran them. Sometimes the math worked out, other times it was off. We knew the code worked, but couldn't figure out why the specs kept failing for it randomly.
- bazzargh 11y agoeek. Time tests should be using something like https://github.com/travisjeffery/timecop https://github.com/travisjeffery/timecop for repeatability. If you do mean to allow random starting values like that, you should look into property-based testing http://www.troikatech.com/blog/2014/04/02/property-based-testing-in-ruby http://www.troikatech.com/blog/2014/04/02/property-based-tes... - test hundreds of possible values at a time, instead of just the one time you ran the tests at.