diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-03-27 15:33:50 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-03-27 15:33:50 -0700 |
commit | 6f4de779c7ece3905e83dc4af7a91f91de19d98f (patch) | |
tree | c1ff27591d4462a6bace644efc0f37eecd56442a /spec | |
parent | 4420692ee683f47b025115edd447d2f59f7cce56 (diff) | |
parent | 7ee733dacf68b44b7bae043fd295dd8a845196e9 (diff) | |
download | chef-6f4de779c7ece3905e83dc4af7a91f91de19d98f.tar.gz |
Merge pull request #948 from thommay/chef-4443
CHEF-4443 - Always save the correct run list
Diffstat (limited to 'spec')
-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 |