From 52c9ad4c9828504ff7859a9dc7ee33d3bdd532c4 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 7 Aug 2006 22:07:33 +0000 Subject: DateTime#to_time gives hour/minute/second resolution. Closes #5747. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/date_ext_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb index 71c2ed1f3a..56161954a0 100644 --- a/activesupport/test/core_ext/date_ext_test.rb +++ b/activesupport/test/core_ext/date_ext_test.rb @@ -10,6 +10,10 @@ class DateExtCalculationsTest < Test::Unit::TestCase assert_equal Time.local(2005, 2, 21), Date.new(2005, 2, 21).to_time end + def test_to_time_on_datetime + assert_equal Time.local(2005, 2, 21, 10, 11, 12), DateTime.new(2005, 2, 21, 10, 11, 12).to_time + end + def test_to_date assert_equal Date.new(2005, 2, 21), Date.new(2005, 2, 21).to_date end -- cgit v1.2.3