Skip to content

Commit 2539919

Browse files
committed
Prefer assert_include for simple strings
1 parent 1dabdc3 commit 2539919

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/psych/visitors/test_yaml_tree.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_yaml_tree_can_take_an_emitter
3434
v << "hello world"
3535
v.finish
3636

37-
assert_match "hello world", io.string
37+
assert_include io.string, "hello world"
3838
end
3939

4040
def test_binary_formatting
@@ -167,9 +167,9 @@ def test_float
167167
end
168168

169169
def test_string
170-
assert_match(/'017'/, Psych.dump({'a' => '017'}))
171-
assert_match(/'019'/, Psych.dump({'a' => '019'}))
172-
assert_match(/'01818'/, Psych.dump({'a' => '01818'}))
170+
assert_include(Psych.dump({'a' => '017'}), "'017'")
171+
assert_include(Psych.dump({'a' => '019'}), "'019'")
172+
assert_include(Psych.dump({'a' => '01818'}), "'01818'")
173173
end
174174

175175
# http://yaml.org/type/null.html

0 commit comments

Comments
 (0)