From 53c1cd6cde6e34996ff85960f06749b681200908 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 5 May 2010 00:30:15 +0200 Subject: let Time.time_with_datetime_fallback handle properly years in the range 0..138 --- activesupport/test/core_ext/date_time_ext_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/test/core_ext/date_time_ext_test.rb') 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 -- cgit v1.2.3