diff options
author | Xavier Noria <fxn@hashref.com> | 2010-05-05 00:30:15 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-05-05 00:35:06 +0200 |
commit | 53c1cd6cde6e34996ff85960f06749b681200908 (patch) | |
tree | 9d69ca78887aa9222a09b945cae581eb70b0d11c /activesupport/test/core_ext/date_time_ext_test.rb | |
parent | 38da0ace772e6f9f5e2fff74db76237ab31790fa (diff) | |
download | rails-53c1cd6cde6e34996ff85960f06749b681200908.tar.gz rails-53c1cd6cde6e34996ff85960f06749b681200908.tar.bz2 rails-53c1cd6cde6e34996ff85960f06749b681200908.zip |
let Time.time_with_datetime_fallback handle properly years in the range 0..138
Diffstat (limited to 'activesupport/test/core_ext/date_time_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/date_time_ext_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index 278c05797b..f9af059acd 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -40,6 +40,11 @@ class DateTimeExtCalculationsTest < Test::Unit::TestCase assert_equal DateTime.new(2005, 2, 21, 10, 11, 12, Rational(-5, 24)), DateTime.new(2005, 2, 21, 10, 11, 12, Rational(-5, 24)).to_time end + def test_civil_from_format + assert_equal DateTime.civil(2010, 5, 4, 0, 0, 0, DateTime.local_offset), DateTime.civil_from_format(:local, 2010, 5, 4) + assert_equal DateTime.civil(2010, 5, 4, 0, 0, 0, 0), DateTime.civil_from_format(:utc, 2010, 5, 4) + end + def test_seconds_since_midnight assert_equal 1,DateTime.civil(2005,1,1,0,0,1).seconds_since_midnight assert_equal 60,DateTime.civil(2005,1,1,0,1,0).seconds_since_midnight |