aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/time_ext_test.rb
diff options
context:
space:
mode:
authorGeoff Buesing <gbuesing@gmail.com>2010-01-27 20:16:08 -0600
committerGeoff Buesing <gbuesing@gmail.com>2010-01-27 20:17:09 -0600
commite98f9579c472e75f5a8c0678f2fc54b2d681e3ec (patch)
treeb086a8cb78daa5f703fcf2597b466d081e77da03 /activesupport/test/core_ext/time_ext_test.rb
parent016f15dc69b876c62606d267dcbb8124d0ad02a5 (diff)
downloadrails-e98f9579c472e75f5a8c0678f2fc54b2d681e3ec.tar.gz
rails-e98f9579c472e75f5a8c0678f2fc54b2d681e3ec.tar.bz2
rails-e98f9579c472e75f5a8c0678f2fc54b2d681e3ec.zip
Time#- with a DateTime argument behaves the same as with a Time argument, i.e. returns the difference between self and arg as a Float [#3476 status:resolved]
Diffstat (limited to 'activesupport/test/core_ext/time_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/time_ext_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/time_ext_test.rb b/activesupport/test/core_ext/time_ext_test.rb
index f6003bc083..08c079e113 100644
--- a/activesupport/test/core_ext/time_ext_test.rb
+++ b/activesupport/test/core_ext/time_ext_test.rb
@@ -722,6 +722,10 @@ class TimeExtCalculationsTest < Test::Unit::TestCase
def test_minus_with_time_with_zone
assert_equal 86_400.0, Time.utc(2000, 1, 2) - ActiveSupport::TimeWithZone.new( Time.utc(2000, 1, 1), ActiveSupport::TimeZone['UTC'] )
end
+
+ def test_minus_with_datetime
+ assert_equal 86_400.0, Time.utc(2000, 1, 2) - DateTime.civil(2000, 1, 1)
+ end
def test_time_created_with_local_constructor_cannot_represent_times_during_hour_skipped_by_dst
with_env_tz 'US/Eastern' do