1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add missing nsec test for 17f5d8e

This commit is contained in:
Andrew White 2013-06-13 12:21:19 +01:00
parent 17f5d8e062
commit a272d0cbe2

View file

@ -450,6 +450,11 @@ class TimeWithZoneTest < ActiveSupport::TestCase
assert_equal 500000, twz.usec assert_equal 500000, twz.usec
end 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 def test_utc_to_local_conversion_saves_period_in_instance_variable
assert_nil @twz.instance_variable_get('@period') assert_nil @twz.instance_variable_get('@period')
@twz.time @twz.time