summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2015-02-11 07:51:07 -0800
committertyler-ball <tyleraball@gmail.com>2015-02-11 15:17:13 -0800
commit29554013c62ee754e426f7a63a38ed62e10a6f2b (patch)
tree70832fd2e4f549221fe5ece58fede40083a3ca8a /spec
parent68bab0b362c47e5a75492e57094f72ecee1171ae (diff)
downloadchef-29554013c62ee754e426f7a63a38ed62e10a6f2b.tar.gz
Finishing tests for https://github.com/chef/chef/pull/2338, fixes https://github.com/chef/chef/issues/1974tball/complete-2338
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/knife/core/ui_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/knife/core/ui_spec.rb b/spec/unit/knife/core/ui_spec.rb
index 83fff4c082..ac42ad6dd6 100644
--- a/spec/unit/knife/core/ui_spec.rb
+++ b/spec/unit/knife/core/ui_spec.rb
@@ -356,6 +356,18 @@ EOM
@ui.config[:attribute] = ["gi", "hi"]
expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "gi" => "go", "hi"=> "ho" } })
end
+
+ it "should handle attributes named the same as methods" do
+ input = { "keys" => "values", "hi" => "ho", "id" => "sample-data-bag-item" }
+ @ui.config[:attribute] = "keys"
+ expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "keys" => "values" } })
+ end
+
+ it "should handle nested attributes named the same as methods" do
+ input = { "keys" => {"keys" => "values"}, "hi" => "ho", "id" => "sample-data-bag-item" }
+ @ui.config[:attribute] = "keys.keys"
+ expect(@ui.format_for_display(input)).to eq({ "sample-data-bag-item" => { "keys.keys" => "values" } })
+ end
end
describe "with --run-list passed" do