aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/range_ext_test.rb
diff options
context:
space:
mode:
authorgsphanikumar <gsphanikumar@gmail.com>2012-12-22 21:46:42 +0530
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-14 00:51:43 -0200
commit0246712bc15201ea1e8285af5adc5b2620538b5d (patch)
treeee681601b90501daaf35d615bc6591df32b764d6 /activesupport/test/core_ext/range_ext_test.rb
parent242f12506de87c743e753c19cee164f87a888519 (diff)
downloadrails-0246712bc15201ea1e8285af5adc5b2620538b5d.tar.gz
rails-0246712bc15201ea1e8285af5adc5b2620538b5d.tar.bz2
rails-0246712bc15201ea1e8285af5adc5b2620538b5d.zip
Test to allow Range including DateTime and DateTime::Infinity
Closes #8587
Diffstat (limited to 'activesupport/test/core_ext/range_ext_test.rb')
-rw-r--r--activesupport/test/core_ext/range_ext_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/range_ext_test.rb b/activesupport/test/core_ext/range_ext_test.rb
index 0051c48984..6e94d5e10d 100644
--- a/activesupport/test/core_ext/range_ext_test.rb
+++ b/activesupport/test/core_ext/range_ext_test.rb
@@ -13,6 +13,12 @@ class RangeTest < ActiveSupport::TestCase
date_range = Time.utc(2005, 12, 10, 15, 30)..Time.utc(2005, 12, 10, 17, 30)
assert_equal "BETWEEN '2005-12-10 15:30:00' AND '2005-12-10 17:30:00'", date_range.to_s(:db)
end
+
+ def test_date_range
+ assert_instance_of Range, DateTime.new..DateTime.new
+ assert_instance_of Range, DateTime::Infinity.new..DateTime::Infinity.new
+ assert_instance_of Range, DateTime.new..DateTime::Infinity.new
+ end
def test_overlaps_last_inclusive
assert((1..5).overlaps?(5..10))