Skip to content

Make Time#to_r consistent with MRI#1790

Merged
enebo merged 1 commit intojruby:masterfrom
robin850:time-to-r
Jul 9, 2014
Merged

Make Time#to_r consistent with MRI#1790
enebo merged 1 commit intojruby:masterfrom
robin850:time-to-r

Conversation

@robin850
Copy link
Contributor

@robin850 robin850 commented Jul 5, 2014

Hello,

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
@enebo enebo added this to the JRuby 1.7.14 milestone Jul 9, 2014
@robin850 robin850 deleted the time-to-r branch July 9, 2014 17:16
@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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants