summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-07-30 16:58:56 -0700
committerGitHub <noreply@github.com>2020-07-30 16:58:56 -0700
commit8a2cedac806d42fc3e7592f7ec925ab2c1b0044a (patch)
tree9b9b46b2657e3458ff14994f1da09d7223034d16
parente11b3b7b75764c99d1f12f192e6e38c4703117f2 (diff)
parent11abf881c57db4d9a5f8d30fc3847abc3bd8e39b (diff)
downloadchef-8a2cedac806d42fc3e7592f7ec925ab2c1b0044a.tar.gz
Merge pull request #10220 from chef/fix-test-yaml-diffs
Compensate for libyaml changes in yaml parsing test.
-rw-r--r--spec/unit/node/immutable_collections_spec.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/node/immutable_collections_spec.rb b/spec/unit/node/immutable_collections_spec.rb
index ff8a6d389d..5ced8053a0 100644
--- a/spec/unit/node/immutable_collections_spec.rb
+++ b/spec/unit/node/immutable_collections_spec.rb
@@ -73,7 +73,11 @@ shared_examples_for "Immutable#to_yaml" do
end
it "should create a YAML string with content" do
- expect(copy).to eq(parsed_yaml)
+ # Roundtrip the test string through YAML to compensate for some changes in libyaml-0.2.5
+ # See: https://github.com/yaml/libyaml/pull/186
+ expected = YAML.dump(YAML.load(parsed_yaml))
+
+ expect(copy).to eq(expected)
end
end
@@ -241,7 +245,7 @@ describe Chef::Node::ImmutableArray do
describe "to_yaml" do
let(:copy) { @immutable_nested_array.to_yaml }
- let(:parsed_yaml) { "---\n- level1\n- - foo\n - bar\n - baz\n - 1\n - 2\n - 3\n - \n - true\n - false\n - - el\n - 0\n - \n- m: m\n" }
+ let(:parsed_yaml) { "---\n- level1\n- - foo\n - bar\n - baz\n - 1\n - 2\n - 3\n -\n - true\n - false\n - - el\n - 0\n -\n- m: m\n" }
include_examples "Immutable#to_yaml"
end