summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-06-25 14:46:08 -0700
committerJay Mundrawala <jdmundrawala@gmail.com>2015-06-25 14:46:08 -0700
commit461f8fd714977f3d8353df0cc187bf601bc55a9a (patch)
tree795105cbc8c866ebd8e73ef9592c5081e3c8d8f1
parentcf3bbb0dcd78dde44394cf0dda70d7ceef097b9b (diff)
downloadchef-461f8fd714977f3d8353df0cc187bf601bc55a9a.tar.gz
Added spec to check that blocks gain priority for resolution
-rw-r--r--spec/unit/node_map_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/node_map_spec.rb b/spec/unit/node_map_spec.rb
index 9b5ff5e8c6..7b37ea59f4 100644
--- a/spec/unit/node_map_spec.rb
+++ b/spec/unit/node_map_spec.rb
@@ -131,6 +131,18 @@ describe Chef::NodeMap do
allow(node).to receive(:[]).with(:platform_version).and_return("6.0")
expect(node_map.get(node, :thing)).to eql(nil)
end
+
+ context "when there is a less specific definition" do
+ before do
+ node_map.set(:thing, :bar, platform_family: "rhel")
+ end
+
+ it "returns the value when the node matches" do
+ allow(node).to receive(:[]).with(:platform_family).and_return("rhel")
+ allow(node).to receive(:[]).with(:platform_version).and_return("7.0")
+ expect(node_map.get(node, :thing)).to eql(:foo)
+ end
+ end
end
describe "resource back-compat testing" do