aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-26 01:07:25 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-26 01:07:25 +0000
commit66bde4ca521eddb3210f8d5a0ab20e55a3047e9c (patch)
tree2f8862cb27ce167fe96506eecc917c492d994347 /activesupport/test/core_ext/time_ext_test.rb
parent26f88892a96cf6297572ca6a644d5fbcbb1f2f10 (diff)
downloadrails-66bde4ca521eddb3210f8d5a0ab20e55a3047e9c.tar.gz
rails-66bde4ca521eddb3210f8d5a0ab20e55a3047e9c.tar.bz2
rails-66bde4ca521eddb3210f8d5a0ab20e55a3047e9c.zip
DateTime uses Time formats. Closes #8476.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6854 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb6
1 files changed, 6 insertions, 0 deletions
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