aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_time_ext_test.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2008-03-17 03:45:32 +0000
committerGeoff Buesing <gbuesing@gmail.com>2008-03-17 03:45:32 +0000
commitb132413885cff785851980dc1740a003109214b7 (patch)
tree074620a90d288f7dc0d291fde30ce763dd79b621 /activesupport/test/core_ext/date_time_ext_test.rb
parent895487c1224bf85047f317e7bddf4f2abdea0822 (diff)
downloadrails-b132413885cff785851980dc1740a003109214b7.tar.gz
rails-b132413885cff785851980dc1740a003109214b7.tar.bz2
rails-b132413885cff785851980dc1740a003109214b7.zip
Adding TimeZone#at and DateTime#to_f
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/core_ext/date_time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/date_time_ext_test.rb5
1 files changed, 5 insertions, 0 deletions
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')