Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Time#to_r consistent with MRI #1790

merged 1 commit into from Jul 9, 2014

Make Time#to_r consistent with MRI #1790

merged 1 commit into from Jul 9, 2014


Copy link

@robin850 robin850 commented Jul 5, 2014


There is an inconsistency between MRI and JRuby when dealing with a Time object then calling to_r on it. JRuby returns simply the numerator of the Rational if the latter has 1 as its denominator.

The commit introducing this feature is e748f0d ; this if call was there to make this spec to pass but it has been updated later (thanks Ben Browning for the investigation work here).

This makes the following assertion to pass now.

Have a nice day.

Let's make JRuby matches the behavior of MRI when calling to_r on a Time
object. It used to return only the numerator of the Rational object if
the denominator was equal to 1.
enebo added a commit that referenced this pull request Jul 9, 2014
Make Time#to_r consistent with MRI
@enebo enebo merged commit d363904 into jruby:master Jul 9, 2014
1 check failed
1 check failed
continuous-integration/travis-ci The Travis CI build failed
@enebo enebo added this to the JRuby 1.7.14 milestone Jul 9, 2014
@robin850 robin850 deleted the robin850:time-to-r branch Jul 9, 2014
@enebo enebo modified the milestones: JRuby 1.7.14, JRuby 1.7.15 Aug 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants