From e9651deea4145f62224af56af027bfbb3e45e4cd Mon Sep 17 00:00:00 2001 From: Akira Matsuda <ronnie@dio.jp> Date: Sat, 27 Jul 2019 12:49:45 +0900 Subject: Use assert_match / assert_no_match for asserting match --- actionpack/test/dispatch/mime_type_test.rb | 12 ++++++------ activesupport/test/time_zone_test.rb | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/actionpack/test/dispatch/mime_type_test.rb b/actionpack/test/dispatch/mime_type_test.rb index 50f6c06fee..da417a1604 100644 --- a/actionpack/test/dispatch/mime_type_test.rb +++ b/actionpack/test/dispatch/mime_type_test.rb @@ -167,12 +167,12 @@ class MimeTypeTest < ActiveSupport::TestCase end test "regexp matcher" do - assert Mime[:js] =~ "text/javascript" - assert Mime[:js] =~ "application/javascript" - assert Mime[:js] !~ "text/html" - assert_not (Mime[:js] !~ "text/javascript") - assert_not (Mime[:js] !~ "application/javascript") - assert Mime[:html] =~ "application/xhtml+xml" + assert_match Mime[:js], "text/javascript" + assert_match Mime[:js], "application/javascript" + assert_no_match Mime[:js], "text/html" + assert_match Mime[:js], "text/javascript" + assert_match Mime[:js], "application/javascript" + assert_match Mime[:html], "application/xhtml+xml" end test "can be initialized with wildcards" do diff --git a/activesupport/test/time_zone_test.rb b/activesupport/test/time_zone_test.rb index f948c363df..0c3a10995c 100644 --- a/activesupport/test/time_zone_test.rb +++ b/activesupport/test/time_zone_test.rb @@ -712,9 +712,9 @@ class TimeZoneTest < ActiveSupport::TestCase def test_zone_match zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] - assert zone =~ /Eastern/ - assert zone =~ /New_York/ - assert zone !~ /Nonexistent_Place/ + assert_match zone, /Eastern/ + assert_match zone, /New_York/ + assert_no_match zone, /Nonexistent_Place/ end def test_to_s -- cgit v1.2.3