diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-10-01 02:16:15 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-10-01 02:16:15 +0000 |
commit | 22dc11c6b17c22247b4e3d1b2b0329d9ca638da6 (patch) | |
tree | 676f851bd9233d7d0be26b6345c4c614597a0581 /activesupport/test/core_ext/date_time_ext_test.rb | |
parent | ec4989618ec08d20024a05500bea088514fbdfd4 (diff) | |
download | rails-22dc11c6b17c22247b4e3d1b2b0329d9ca638da6.tar.gz rails-22dc11c6b17c22247b4e3d1b2b0329d9ca638da6.tar.bz2 rails-22dc11c6b17c22247b4e3d1b2b0329d9ca638da6.zip |
Fixed Date#xmlschema for dates outside the range of what can be created with Time (closes #9744) [gbuesing]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7707 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/date_time_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/date_time_ext_test.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index 204e8cd676..6984481a71 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -182,8 +182,13 @@ class DateTimeExtCalculationsTest < Test::Unit::TestCase assert_equal DateTime.civil(2004, 2, 29), DateTime.civil(2004, 3, 31).last_month end - def test_xmlschema_is_available - assert_nothing_raised { DateTime.now.xmlschema } + def test_xmlschema + assert_equal '1880-02-28T15:15:10Z', DateTime.civil(1880, 2, 28, 15, 15, 10).xmlschema + assert_equal '1980-02-28T15:15:10Z', DateTime.civil(1980, 2, 28, 15, 15, 10).xmlschema + assert_equal '2080-02-28T15:15:10Z', DateTime.civil(2080, 2, 28, 15, 15, 10).xmlschema + assert_equal '1880-02-28T15:15:10-06:00', DateTime.civil(1880, 2, 28, 15, 15, 10, -0.25).xmlschema + assert_equal '1980-02-28T15:15:10-06:00', DateTime.civil(1980, 2, 28, 15, 15, 10, -0.25).xmlschema + assert_equal '2080-02-28T15:15:10-06:00', DateTime.civil(2080, 2, 28, 15, 15, 10, -0.25).xmlschema end def test_acts_like_time |