From b132413885cff785851980dc1740a003109214b7 Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Mon, 17 Mar 2008 03:45:32 +0000 Subject: Adding TimeZone#at and DateTime#to_f git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/core_ext/date_time_ext_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/date_time_ext_test.rb b/activesupport/test/core_ext/date_time_ext_test.rb index cb9b6530c9..42aaf0ebad 100644 --- a/activesupport/test/core_ext/date_time_ext_test.rb +++ b/activesupport/test/core_ext/date_time_ext_test.rb @@ -271,6 +271,11 @@ class DateTimeExtCalculationsTest < Test::Unit::TestCase assert_equal 0, DateTime.civil(2000) <=> ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1, 0, 0, 0), TimeZone['UTC'] ) assert_equal(-1, DateTime.civil(2000) <=> ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1, 0, 0, 1), TimeZone['UTC'] )) end + + def test_to_f + assert_equal 946684800.0, DateTime.civil(2000).to_f + assert_equal 946684800.0, DateTime.civil(1999,12,31,19,0,0,Rational(-5,24)).to_f + end protected def with_env_tz(new_tz = 'US/Eastern') -- cgit v1.2.3