aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_with_zone_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-06-13 12:21:19 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2013-06-13 12:21:19 +0100
commita272d0cbe22369948e4fedf66a5889240b5e7b25 (patch)
tree58888869efd85b244a35efd1c81daf9235a9b96b /activesupport/test/core_ext/time_with_zone_test.rb
parent17f5d8e062909f1fcae25351834d8e89967b645e (diff)
downloadrails-a272d0cbe22369948e4fedf66a5889240b5e7b25.tar.gz
rails-a272d0cbe22369948e4fedf66a5889240b5e7b25.tar.bz2
rails-a272d0cbe22369948e4fedf66a5889240b5e7b25.zip
Add missing nsec test for 17f5d8e
Diffstat (limited to 'activesupport/test/core_ext/time_with_zone_test.rb')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_with_zone_test.rb b/activesupport/test/core_ext/time_with_zone_test.rb
index e8eea27d72..ddcfcc491f 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -450,6 +450,11 @@ class TimeWithZoneTest < ActiveSupport::TestCase
assert_equal 500000, twz.usec
end
+ def test_nsec_returns_sec_fraction_when_datetime_is_wrapped
+ twz = ActiveSupport::TimeWithZone.new(DateTime.civil(2000, 1, 1, 0, 0, Rational(1,2)), @time_zone)
+ assert_equal 500000000, twz.nsec
+ end
+
def test_utc_to_local_conversion_saves_period_in_instance_variable
assert_nil @twz.instance_variable_get('@period')
@twz.time