diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-07-02 15:02:22 -0700 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-07-02 15:02:22 -0700 |
commit | 6ee17968db8f8a078e843cb97eb5ab62e3d021d5 (patch) | |
tree | 94f8360a188fe2b6aae286d0962913efb3f3ddc8 /activesupport/test | |
parent | a4104278b5cc5a7e7b15473c1ea74125f915f2db (diff) | |
parent | d75992b0b22b656d16a28c04eac771a93486f465 (diff) | |
download | rails-6ee17968db8f8a078e843cb97eb5ab62e3d021d5.tar.gz rails-6ee17968db8f8a078e843cb97eb5ab62e3d021d5.tar.bz2 rails-6ee17968db8f8a078e843cb97eb5ab62e3d021d5.zip |
Merge pull request #16001 from johnpaulashenfelter/jp_fix_datetime_to_f
`DateTime#to_f` now preserves fractional seconds.
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/date_time_ext_test.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index 2c08b46791..74319ecd09 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -338,6 +338,7 @@ class DateTimeExtCalculationsTest < ActiveSupport::TestCase def test_to_f assert_equal 946684800.0, DateTime.civil(2000).to_f assert_equal 946684800.0, DateTime.civil(1999,12,31,19,0,0,Rational(-5,24)).to_f + assert_equal 946684800.5, DateTime.civil(1999,12,31,19,0,0.5,Rational(-5,24)).to_f end def test_to_i |