summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-07-28 16:22:30 -0700
committerPete Higgins <pete@peterhiggins.org>2020-07-28 16:22:30 -0700
commit11abf881c57db4d9a5f8d30fc3847abc3bd8e39b (patch)
tree7399dfb0eb4b109704c2b421e5ab48ae259b4c42
parentacffd83f97f8e9551c19bf6a60ad300876e15543 (diff)
downloadchef-11abf881c57db4d9a5f8d30fc3847abc3bd8e39b.tar.gz
Compensate for libyaml changes in yaml parsing test.fix-test-yaml-diffs
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-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