aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/date_ext_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2013-06-03 16:42:41 +0200
committerDavid Heinemeier Hansson <david@loudthinking.com>2013-06-03 16:47:48 +0200
commita6fe33d8a3c09f3a70ee2a79f96ed5b2c9580d4f (patch)
treeea4a9dcced4302e0808ae46190d15ae11b06b600 /activesupport/test/core_ext/date_ext_test.rb
parentbb3d9a6f6c74dc1591639b779bf4272b272f93df (diff)
downloadrails-a6fe33d8a3c09f3a70ee2a79f96ed5b2c9580d4f.tar.gz
rails-a6fe33d8a3c09f3a70ee2a79f96ed5b2c9580d4f.tar.bz2
rails-a6fe33d8a3c09f3a70ee2a79f96ed5b2c9580d4f.zip
Allow Date to be compared with Time (like it was possible to compare Time with Date)
Diffstat (limited to 'activesupport/test/core_ext/date_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/date_ext_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/date_ext_test.rb b/activesupport/test/core_ext/date_ext_test.rb
index b1adf6d396..aa5e4461fd 100644
--- a/activesupport/test/core_ext/date_ext_test.rb
+++ b/activesupport/test/core_ext/date_ext_test.rb
@@ -48,6 +48,10 @@ class DateExtCalculationsTest < ActiveSupport::TestCase
end
end
+ def test_compare_to_time
+ assert Date.yesterday < Time.now
+ end
+
def test_to_datetime
assert_equal DateTime.civil(2005, 2, 21), Date.new(2005, 2, 21).to_datetime
assert_equal 0, Date.new(2005, 2, 21).to_datetime.offset # use UTC offset