From 66bde4ca521eddb3210f8d5a0ab20e55a3047e9c Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 26 May 2007 01:07:25 +0000 Subject: DateTime uses Time formats. Closes #8476. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6854 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/time_ext_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'activesupport/test/core_ext/time_ext_test.rb') diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb index 87ee8c2894..38a6389674 100644 --- a/activesupport/test/core_ext/time_ext_test.rb +++ b/activesupport/test/core_ext/time_ext_test.rb @@ -281,6 +281,12 @@ class TimeExtCalculationsTest < Test::Unit::TestCase time = Time.utc(2005, 2, 21, 17, 44, 30) assert_equal "Mon, 21 Feb 2005 17:44:30 +0000", time.to_s(:rfc822) end + + def test_custom_date_format + Time::DATE_FORMATS[:custom] = '%Y%m%d%H%M%S' + assert_equal '20050221143000', Time.local(2005, 2, 21, 14, 30, 0).to_s(:custom) + Time::DATE_FORMATS.delete(:custom) + end def test_to_date assert_equal Date.new(2005, 2, 21), Time.local(2005, 2, 21, 17, 44, 30).to_date -- cgit v1.2.3