1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Use assert_match / assert_no_match for asserting match"

This reverts commit e9651deea4.

Now we're having both `=~` and `match?` for these objects, and it's nicer to have explicit tests for both of them
This commit is contained in:
Akira Matsuda 2019-07-29 14:05:51 +09:00
parent 8f90ac7827
commit 26edd1d112
2 changed files with 9 additions and 9 deletions

View file

@ -167,12 +167,12 @@ class MimeTypeTest < ActiveSupport::TestCase
end end
test "regexp matcher" do test "regexp matcher" do
assert_match Mime[:js], "text/javascript" assert Mime[:js] =~ "text/javascript"
assert_match Mime[:js], "application/javascript" assert Mime[:js] =~ "application/javascript"
assert_no_match Mime[:js], "text/html" assert Mime[:js] !~ "text/html"
assert_match Mime[:js], "text/javascript" assert_not (Mime[:js] !~ "text/javascript")
assert_match Mime[:js], "application/javascript" assert_not (Mime[:js] !~ "application/javascript")
assert_match Mime[:html], "application/xhtml+xml" assert Mime[:html] =~ "application/xhtml+xml"
end end
test "match?" do test "match?" do

View file

@ -712,9 +712,9 @@ class TimeZoneTest < ActiveSupport::TestCase
def test_zone_match def test_zone_match
zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"] zone = ActiveSupport::TimeZone["Eastern Time (US & Canada)"]
assert_match zone, /Eastern/ assert zone =~ /Eastern/
assert_match zone, /New_York/ assert zone =~ /New_York/
assert_no_match zone, /Nonexistent_Place/ assert zone !~ /Nonexistent_Place/
end end
def test_zone_match? def test_zone_match?