From 50e78d61d00eb0a984d760d5c2035aa8cf3ff291 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 20 Sep 2016 14:41:39 -0700 Subject: add spec around node['class'] vs. node.class behavior we want attributes before methods Signed-off-by: Lamont Granquist --- spec/unit/knife/core/ui_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb index 44b7cb1e5c..be77fd8501 100644 --- a/spec/unit/knife/core/ui_spec.rb +++ b/spec/unit/knife/core/ui_spec.rb @@ -383,6 +383,13 @@ EOM expect(@ui.format_for_display(input)).to eq( { "chef.localdomain" => { "name" => "chef.localdomain" } }) end + it "should return a 'class' attribute and not the node.class" do + input = Chef::Node.new + input.default["class"] = "classy!" + @ui.config[:attribute] = "class" + expect(@ui.format_for_display(input)).to eq( { nil => { "class" => "classy!" } } ) + end + it "should return the chef_environment attribute" do input = Chef::Node.new input.chef_environment = "production-partner-load-integration-preview-testing" -- cgit v1.2.1