aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_with_zone_test.rb
diff options
context:
space:
mode:
authorNicholas Dainty <nick@npad.co.uk>2009-01-10 14:09:29 +0000
committergbuesing <gbuesing@gmail.com>2009-01-11 13:56:07 -0600
commit296ca4da1700eb27a7043112d22027444ea0e548 (patch)
treee2c217bb6cd620ece4b57a20c9b42f2c456be7d9 /activesupport/test/core_ext/time_with_zone_test.rb
parentf1fff0a4808f2bcdca0a640fb6530d7c33fe69dc (diff)
downloadrails-296ca4da1700eb27a7043112d22027444ea0e548.tar.gz
rails-296ca4da1700eb27a7043112d22027444ea0e548.tar.bz2
rails-296ca4da1700eb27a7043112d22027444ea0e548.zip
TimeWithZone#xmlschema accepts optional fraction_digits argument [#1725 state:resolved]
Diffstat (limited to 'activesupport/test/core_ext/time_with_zone_test.rb')
-rw-r--r--activesupport/test/core_ext/time_with_zone_test.rb9
1 files changed, 9 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 7c8fb7dd94..4dc1fec559 100644
--- a/activesupport/test/core_ext/time_with_zone_test.rb
+++ b/activesupport/test/core_ext/time_with_zone_test.rb
@@ -105,6 +105,15 @@ class TimeWithZoneTest < Test::Unit::TestCase
end
end
+ def test_xmlschema_with_fractional_seconds
+ silence_warnings do # silence warnings raised by tzinfo gem
+ @twz += 0.123456 # advance the time by a fraction of a second
+ assert_equal "1999-12-31T19:00:00.123-05:00", @twz.xmlschema(3)
+ assert_equal "1999-12-31T19:00:00.123456-05:00", @twz.xmlschema(6)
+ assert_equal "1999-12-31T19:00:00.123456-05:00", @twz.xmlschema(12)
+ end
+ end
+
def test_to_yaml
silence_warnings do # silence warnings raised by tzinfo gem
assert_equal "--- 1999-12-31 19:00:00 -05:00\n", @twz.to_yaml