summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-10-28 02:40:44 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-10-28 02:40:44 +0530
commitef2fbf960564d094e8c310dc3991d3fb477ddf30 (patch)
treecdd1d59ee5a659b7a953dc941ccbc69c242ff441 /spec
parent18fa2a105001a053be46fd3be1b4dd3f7e2a74ce (diff)
downloadchef-ef2fbf960564d094e8c310dc3991d3fb477ddf30.tar.gz
Add format supported option in values
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/application/knife_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb
index ea5083ac15..4b727eef93 100644
--- a/spec/unit/application/knife_spec.rb
+++ b/spec/unit/application/knife_spec.rb
@@ -77,6 +77,23 @@ describe Chef::Application::Knife do
expect(Chef::Config[:color]).to be_truthy
end
+ context "validate --format option" do
+ it "should set the default format summary" do
+ with_argv(*%w{noop knife command}) do
+ expect(@knife).to receive(:exit).with(0)
+ @knife.run
+ expect(@knife.default_config[:format]).to eq("summary")
+ end
+ end
+
+ it "should raise the error for invalid value" do
+ with_argv(*%w{noop knife command -F abc}) do
+ expect(STDOUT).to receive(:puts).at_least(2).times
+ expect { @knife.run }.to raise_error(SystemExit) { |e| expect(e.status).to eq(2) }
+ end
+ end
+ end
+
context "when given fips flags" do
context "when Chef::Config[:fips]=false" do
before do