Skip to content

Commit 40b512c

Browse files
committed
assert_match instead of assert a =~ /a/
1 parent 5963844 commit 40b512c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_address_extractor.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ def test_replace_first_address
2727
assert_match /^\s*123 Foo St., Someplace FL\s*/, address
2828
"skidoosh"
2929
end
30-
assert string =~ /Please send the package to skidoosh/
30+
assert_match /Please send the package to skidoosh/, string
3131
end
3232

3333
def test_replace_addresses
3434
string = AddressExtractor.replace_addresses(test_data.first[:input]) do |address_hash, address|
3535
"skidoosh"
3636
end
37-
assert string =~ /Please send the package to skidoosh/
38-
assert string =~ /via mail at:\s+skidoosh/
37+
assert_match /Please send the package to skidoosh/, string
38+
assert_match /via mail at:\s+skidoosh/, string
3939
end
4040

4141
def test_no_addresses_found

0 commit comments

Comments
 (0)