• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mperham / sidekiq / 2028 / 6
46%
master: 46%

Build:
DEFAULT BRANCH: master
Ran 20 Feb 2015 12:47AM UTC
Files 46
Run time 8s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Feb 2015 12:43AM UTC coverage: 94.107%. Remained the same
rbx-2

Pull #2198

travis-ci

dstosik
MyWorker.perform_in(1.month) does not always schedule job in one month.

At the moment, `MyWorker.perform_in(1.month)` always schedules a job in 30
days. When added to a date, `1.month` will add 1 to the date's month count,
which means that it will add 28, 29, 30, or 31 days depending on the month and
year.
When I call `MyWorker.perform_in(1.month)`, I would expect the job to be
scheduled next month, same day of the month, all the time. At the moment, it is
true only four months in the year.
My pull request tries to fix this by converting the interval object to a Float
at the last possible moment.
Plaese note that the test I wrote will fail only during months that do not have
30 days. Ideally, I would add a dependency to Timecop and freeze time to any
day in a month of 28, 29 or 31 days. This could also avoid using
`#assert_in_delta`, in favour of `#assert_equal`.

Feel free to read my blog post [Rails' `1.month` has a variable
length](http://dstosik.github.io/rails/2015/02/19/rails-1month-variable-length/)
for more details.
Pull Request #2198: MyWorker.perform_in(1.month) does not always schedule job in one month.

2124 of 2257 relevant lines covered (94.11%)

42.84 hits per line

Source Files on job 2028.6 (rbx-2)
  • Tree
  • List 0
  • Changed 12
  • Source Changed 1
  • Coverage Changed 12
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 2028
  • Travis Job 2028.6
  • deb0dd18 on github
  • Prev Job for rbx-2 on master (#2027.6)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc