Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions test/psych/visitors/test_emitter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def test_document_implicit_end

@visitor.accept s

assert_match(/key: value/, @io.string)
assert_include(@io.string, "key: value")
assert_equal @io.string, s.yaml
assert(/\.\.\./ !~ s.yaml)
assert_not_include(s.yaml, "...")
end

def test_scalar
Expand All @@ -76,7 +76,7 @@ def test_scalar

@visitor.accept s

assert_match(/hello/, @io.string)
assert_include(@io.string, "hello")
assert_equal @io.string, s.yaml
end

Expand All @@ -90,8 +90,8 @@ def test_scalar_with_tag

@visitor.accept s

assert_match(/str/, @io.string)
assert_match(/hello/, @io.string)
assert_include(@io.string, "str")
assert_include(@io.string, "hello")
assert_equal @io.string, s.yaml
end

Expand All @@ -107,7 +107,7 @@ def test_sequence

@visitor.accept s

assert_match(/- hello/, @io.string)
assert_include(@io.string, "- hello")
assert_equal @io.string, s.yaml
end

Expand All @@ -122,7 +122,7 @@ def test_mapping

@visitor.accept s

assert_match(/key: value/, @io.string)
assert_include(@io.string, "key: value")
assert_equal @io.string, s.yaml
end

Expand All @@ -137,7 +137,7 @@ def test_alias

@visitor.accept s

assert_match(/&A key: \*A/, @io.string)
assert_include(@io.string, "&A key: \*A")
assert_equal @io.string, s.yaml
end
end
Expand Down
8 changes: 4 additions & 4 deletions test/psych/visitors/test_yaml_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_yaml_tree_can_take_an_emitter
v << "hello world"
v.finish

assert_match "hello world", io.string
assert_include io.string, "hello world"
end

def test_binary_formatting
Expand Down Expand Up @@ -167,9 +167,9 @@ def test_float
end

def test_string
assert_match(/'017'/, Psych.dump({'a' => '017'}))
assert_match(/'019'/, Psych.dump({'a' => '019'}))
assert_match(/'01818'/, Psych.dump({'a' => '01818'}))
assert_include(Psych.dump({'a' => '017'}), "'017'")
assert_include(Psych.dump({'a' => '019'}), "'019'")
assert_include(Psych.dump({'a' => '01818'}), "'01818'")
end

# http://yaml.org/type/null.html
Expand Down