spec/lib/node_spec.rb in hieracles-0.1.6 vs spec/lib/node_spec.rb in hieracles-0.1.7

- old
+ new

@@ -79,41 +79,54 @@ let(:expected) { [ [ "another.more_sublevel", [{ value: "something", - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: 'something' }] ], [ "another.sublevel.array", [ { value: ["one", "two", "three"], - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: ["one", "three", "two"] }, { value: ["four", "five"], - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: ["five", "four"] } ] ], [ "another.sublevel.thing", [{ value: "always", - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: "always" }] ], [ "common_param.subparam", - [{ - value: "overriden", - file: 'params/nodes/server.example.com.yaml' - }] + [ + { + value: "override-me", + file: 'params/farm/dev.yaml', + merged: "override-me" + }, + { + value: "overriden", + file: 'params/nodes/server.example.com.yaml', + merged: "overriden" + } + ] ], [ "somefarmparam", [{ value: false, - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: false }] ] ] } it { expect(node.params).to eq expected } @@ -231,41 +244,54 @@ let(:expected) { [ [ "another.more_sublevel", [{ value: "something", - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: "something" }] ], [ "another.sublevel.array", [ { value: ["one", "two", "three"], - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: ["one", "three", "two"] }, { value: ["four", "five"], - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: ["five", "four", "one", "three", "two"] } ] ], [ "another.sublevel.thing", [{ value: "always", - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: "always" }] ], [ "common_param.subparam", - [{ - value: "overriden", - file: 'params/nodes/server.example.com.yaml' - }] + [ + { + value: "override-me", + file: 'params/farm/dev.yaml', + merged: "override-me" + }, + { + value: "overriden", + file: 'params/nodes/server.example.com.yaml', + merged: "overriden" + } + ] ], [ "somefarmparam", [{ value: false, - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: false }] ] ] } it { expect(node.params).to eq expected } @@ -280,11 +306,11 @@ "array" => ["five", "four", "one", "three", "two"], "thing" => "always", } }, "common_param" => { - "subparam" => "overriden" + "subparam" => "override-me" }, "somefarmparam" => false } } it { expect(node.params_tree).to eq expected } @@ -308,40 +334,53 @@ let(:expected) { [ [ "another.more_sublevel", [{ value: "something", - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: "something" }] ], [ "another.sublevel.array", [ { value: ["one", "two", "three"], - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: ["one", "three", "two"] }, { value: ["four", "five"], - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: ["five", "four", "one", "three", "two"] } ] ], [ "another.sublevel.thing", [{ value: "always", - file: 'params/nodes/server.example.com.yaml' + file: 'params/nodes/server.example.com.yaml', + merged: "always" }] ], [ "common_param.subparam", - [{ - value: "overriden", - file: 'params/nodes/server.example.com.yaml' - }] + [ + { + value: "override-me", + file: 'params/farm/dev.yaml', + merged: "override-me" + }, + { + value: "overriden", + file: 'params/nodes/server.example.com.yaml', + merged: "overriden" + } + ] ], [ "somefarmparam", [{ value: false, - file: 'params/farm/dev.yaml' + file: 'params/farm/dev.yaml', + merged: false }] ] ] } it { expect(node.params).to eq expected }