summaryrefslogtreecommitdiff
path: root/spec/unit/node_spec.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-08 11:44:22 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-09 11:01:45 -0800
commit4d02117a2868426f80ea8b3e561fbc86ad667b97 (patch)
tree727b8b648439ac7a4a948b32caaca7c70e1952e4 /spec/unit/node_spec.rb
parent5f19be6a6bb96ae54507a64ca4742d50ab68d63f (diff)
downloadchef-4d02117a2868426f80ea8b3e561fbc86ad667b97.tar.gz
Wire "force" default and override into node
The desired behavior works without this match because of method_missing on Chef::Node, but this makes the behavior tested, documented, and explicit.
Diffstat (limited to 'spec/unit/node_spec.rb')
-rw-r--r--spec/unit/node_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index 73075d077b..f8cfd39deb 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -206,6 +206,12 @@ describe Chef::Node do
node.fuu.bahrr.baz.should == "qux"
end
+ it "accesses force defaults via default!" do
+ node.default![:foo] = "wet bar"
+ node.default[:foo] = "bar"
+ node[:foo].should == "wet bar"
+ end
+
end
describe "override attributes" do
@@ -230,6 +236,12 @@ describe Chef::Node do
node.fuu.bahrr.baz.should == "qux"
end
+ it "sets force_overrides via override!" do
+ node.override![:foo] = "wet bar"
+ node.override[:foo] = "bar"
+ node[:foo].should == "wet bar"
+ end
+
end
it "should raise an ArgumentError if you ask for an attribute that doesn't exist via method_missing" do