From 8f90ac7827787a84b38055e1011ef9aedd89fe91 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Mon, 29 Jul 2019 14:05:18 +0900 Subject: Add AS::TimeZone#match? --- activesupport/test/time_zone_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index 0c3a10995c..eccacce32a 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -717,6 +717,13 @@ class TimeZoneTest < ActiveSupport::TestCase assert_no_match zone, /Nonexistent_Place/ end + def test_zone_match? + zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] + assert zone.match?(/Eastern/) + assert zone.match?(/New_York/) + assert_not zone.match?(/Nonexistent_Place/) + end + def test_to_s assert_equal "(GMT+05:30) New Delhi", ActiveSupport::TimeZone["New Delhi"].to_s end -- cgit v1.2.3