diff options
author | danielsdeleo <dan@opscode.com> | 2013-01-25 15:32:17 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2013-01-25 15:32:17 -0800 |
commit | 1cf3a2815e3f244a866521a564531878e00b1e69 (patch) | |
tree | e976694b81abfab4685abb555e1ec95064fad9c0 /spec/unit/node | |
parent | 0df84a5ccc41e4bca12990f0b4a708a24fc56d52 (diff) | |
download | chef-1cf3a2815e3f244a866521a564531878e00b1e69.tar.gz |
make merge between precedence overwrite arrays
Diffstat (limited to 'spec/unit/node')
-rw-r--r-- | spec/unit/node/attribute_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 947de76b1d..8c654679fe 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -284,6 +284,29 @@ describe Chef::Node::Attribute do @attributes["override"].should == "cookbook override" end + it "merges arrays within the default precedence" do + @attributes.role_default["array"] = %w{role} + @attributes.env_default["array"] = %w{env} + @attributes["array"].should == %w{env role} + end + + it "merges arrays within the override precedence" do + @attributes.role_override["array"] = %w{role} + @attributes.env_override["array"] = %w{env} + @attributes["array"].should == %w{role env} + end + + it "does not merge arrays between default and normal" do + @attributes.role_default["array"] = %w{role} + @attributes.normal["array"] = %w{normal} + @attributes["array"].should == %w{normal} + end + + it "does not merge arrays between normal and override" do + @attributes.normal["array"] = %w{normal} + @attributes.role_override["array"] = %w{role} + @attributes["array"].should == %w{role} + end end describe "when reading combined default or override values" do |