Closed d-m-u closed 5 years ago
Hello, thanks for the contribution.
It's a bit hard to see what you mean by this change. Do you have some context for me?
I'll do my best to adapt et-orbi then.
Thanks in advance,
Sure, sorry. We at ManageIQ just updated to rufus 3.6 and we're using a gross patch because our tests use ActiveRecord TimeWithZone and et-orbi on this particular line doesn't support comparisons of EoTime with AR objects.
I think it'd be cool to be able to do something like this with a rufus scheduler:
job = rufus_scheduler.jobs.first
expect(job.next_time).to eq(3.hours.from_now)
meanwhile:
job = rufus_scheduler.jobs.first
expect(job.next_time.to_i).to eq(3.hours.from_now.to_i)
or
job = rufus_scheduler.jobs.first
expect(job.next_time.to_i).to be_within(2).of(3.hours.from_now.to_i)
Yes, but that feels like it shouldn't have to be part of the test itself. Since you're checking for EO types on this line, why not make that as true to Postel's law as possible?
expect(job.next_time).to eq(3.hours.from_now)
is brittle, it only works 3 hours from now, exactlyeq
?Re-opening. I want to make sure comparison with Time and ActiveSupport Time works.
Closing and moving to gh-7.
Hello @d-m-u, would https://github.com/floraison/et-orbi/commit/283f5e207e9a6fe6a50dc2e39fc2e40eebd5b3b5 suit you and your company?
Thank you!!
It'd be nice to handle Rails Durations for comparisons here since as it stands, it doesn't support comparisons with user provided Time objects. Could we do something like this, please?