aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2017-11-09 13:50:50 +0000
committerGitHub <noreply@github.com>2017-11-09 13:50:50 +0000
commiteae65ac2ab7e7a8155fa5a76c15f21cee09499c2 (patch)
treeb6ed0736858d7b68c68bff3d12f00293402d6d7e /activesupport/test
parent518959d0127aac81020ccd50f3dc425f857e6715 (diff)
parent2b434d6f79813dcad162b158fd2b60e34a725ba1 (diff)
downloadrails-eae65ac2ab7e7a8155fa5a76c15f21cee09499c2.tar.gz
rails-eae65ac2ab7e7a8155fa5a76c15f21cee09499c2.tar.bz2
rails-eae65ac2ab7e7a8155fa5a76c15f21cee09499c2.zip
Merge pull request #31081 from rails/allow-include-time-with-zone-range
Allow `Range#include?` on TWZ ranges
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/range_ext_test.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/test/core_ext/range_ext_test.rb b/activesupport/test/core_ext/range_ext_test.rb
index 0467123e55..049fac8fd4 100644
--- a/activesupport/test/core_ext/range_ext_test.rb
+++ b/activesupport/test/core_ext/range_ext_test.rb
@@ -121,9 +121,12 @@ class RangeTest < ActiveSupport::TestCase
def test_include_on_time_with_zone
twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Eastern Time (US & Canada)"] , Time.utc(2006, 11, 28, 10, 30))
- assert_raises TypeError do
- ((twz - 1.hour)..twz).include?(twz)
- end
+ assert ((twz - 1.hour)..twz).include?(twz)
+ end
+
+ def test_case_equals_on_time_with_zone
+ twz = ActiveSupport::TimeWithZone.new(nil, ActiveSupport::TimeZone["Eastern Time (US & Canada)"] , Time.utc(2006, 11, 28, 10, 30))
+ assert ((twz - 1.hour)..twz) === twz
end
def test_date_time_with_each