diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/node_spec.rb | 9 | ||||
-rw-r--r-- | spec/unit/policy_builder/expand_node_object_spec.rb | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb index f2a78f87cd..832e10f645 100644 --- a/spec/unit/node_spec.rb +++ b/spec/unit/node_spec.rb @@ -724,6 +724,15 @@ describe Chef::Node do json.should =~ /\"run_list\":\[\"role\[Cthulu\]\",\"role\[Hastur\]\"\]/ end + it "should serialize the correct run list", :json => true do + node.run_list << "role[marxist]" + node.run_list << "role[leninist]" + node.override_runlist << "role[stalinist]" + node.run_list.should be_include("role[stalinist]") + json = Chef::JSONCompat.to_json(node) + json.should =~ /\"run_list\":\[\"role\[marxist\]\",\"role\[leninist\]\"\]/ + end + it "merges the override components into a combined override object" do node.attributes.role_override["role override"] = "role override" node.attributes.env_override["env override"] = "env override" diff --git a/spec/unit/policy_builder/expand_node_object_spec.rb b/spec/unit/policy_builder/expand_node_object_spec.rb index 5c6f39d28c..a1e0b881d5 100644 --- a/spec/unit/policy_builder/expand_node_object_spec.rb +++ b/spec/unit/policy_builder/expand_node_object_spec.rb @@ -244,7 +244,7 @@ describe Chef::PolicyBuilder::ExpandNodeObject do it "sets the override run_list on the node" do expect(node.run_list).to eq([override_runlist]) - expect(policy_builder.original_runlist).to eq(primary_runlist) + expect(node.primary_runlist).to eq(primary_runlist) end it "reports that a temporary policy is being used" do |