diff options
author | Josh Pencheon <josh.pencheon@googlemail.com> | 2018-05-30 13:42:07 +0100 |
---|---|---|
committer | Josh Pencheon <josh.pencheon@googlemail.com> | 2018-05-30 13:47:39 +0100 |
commit | 45762cec03ee1218d5a257d2920678f37bd9bdb4 (patch) | |
tree | 3f0e6c688fc5e032c0e50551552a1b13a3f2c2cd /activesupport/test | |
parent | 0d7f13a622259ccafe3822d4e4eb7177107974ab (diff) | |
download | rails-45762cec03ee1218d5a257d2920678f37bd9bdb4.tar.gz rails-45762cec03ee1218d5a257d2920678f37bd9bdb4.tar.bz2 rails-45762cec03ee1218d5a257d2920678f37bd9bdb4.zip |
Allow Time.zone.at to receive a second argument
For parity with Ruby's Time::at
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/time_zone_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index b59f3e9405..6d45a6726d 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -225,6 +225,16 @@ class TimeZoneTest < ActiveSupport::TestCase assert_equal secs, twz.to_f end + def test_at_with_microseconds + zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] + secs = 946684800.0 + microsecs = 123456.789 + twz = zone.at(secs, microsecs) + assert_equal zone, twz.time_zone + assert_equal secs, twz.to_i + assert_equal 123456789, twz.nsec + end + def test_iso8601 zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] twz = zone.iso8601("1999-12-31T19:00:00") |