diff options
author | danielsdeleo <dan@opscode.com> | 2012-12-11 14:56:50 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-12-11 14:56:50 -0800 |
commit | 5b343a73679fa33af97f928d02caa4ffa61d8789 (patch) | |
tree | 877a14151f210d606fc0c4434d3e862d0d5d08e1 /spec/unit/node | |
parent | 0cb9354243cd558457a89326f9be526722cd5ca5 (diff) | |
download | chef-5b343a73679fa33af97f928d02caa4ffa61d8789.tar.gz |
[CHEF-3680] don't invalidate computed attributes on dup
Diffstat (limited to 'spec/unit/node')
-rw-r--r-- | spec/unit/node/attribute_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/node/attribute_spec.rb b/spec/unit/node/attribute_spec.rb index 8345da118c..d568d6fc15 100644 --- a/spec/unit/node/attribute_spec.rb +++ b/spec/unit/node/attribute_spec.rb @@ -1038,6 +1038,17 @@ describe Chef::Node::Attribute do end end + describe "when not mutated" do + + it "does not reset the cache when dup'd [CHEF-3680]" do + @attributes.default[:foo][:bar] = "set on original" + subtree = @attributes[:foo] + @attributes.default[:foo].dup[:bar] = "set on dup" + subtree[:bar].should == "set on original" + end + + end + describe "when setting a component attribute to a new value" do it "converts the input in to a VividMash tree (default)" do @attributes.default = {} |