mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Test to allow Range including DateTime and DateTime::Infinity
Closes #8587
This commit is contained in:
parent
242f12506d
commit
0246712bc1
1 changed files with 6 additions and 0 deletions
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue