summaryrefslogtreecommitdiff
path: root/spec/unit/application/knife_spec.rb
diff options
context:
space:
mode:
authorkaustubh-d <kaustubh@clogeny.com>2013-05-10 16:39:30 +0530
committeradamedx <adamed@opscode.com>2013-05-13 21:43:51 -0700
commit6b377956fb53f878a93739b5c2bdf81396423a60 (patch)
treef9033246ba42db74ee4db8375e390a9737111444 /spec/unit/application/knife_spec.rb
parentfb0ff50ecae178360d315397b3fa5eb6ec3a8492 (diff)
downloadchef-6b377956fb53f878a93739b5c2bdf81396423a60.tar.gz
test case for colored output flag for knife
Diffstat (limited to 'spec/unit/application/knife_spec.rb')
-rw-r--r--spec/unit/application/knife_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/application/knife_spec.rb b/spec/unit/application/knife_spec.rb
index 9560de8d13..dde79d6c05 100644
--- a/spec/unit/application/knife_spec.rb
+++ b/spec/unit/application/knife_spec.rb
@@ -61,6 +61,18 @@ describe Chef::Application::Knife do
end
end
+ it "should set default colored output to false on windows and true otherwise" do
+ with_argv(*%w{noop knife command}) do
+ @knife.should_receive(:exit).with(0)
+ @knife.run
+ end
+ if windows?
+ Chef::Config[:color].should be_false
+ else
+ Chef::Config[:color].should be_true
+ end
+ end
+
describe "when given a path to the client key" do
it "expands a relative path relative to the CWD" do
relative_path = '.chef/client.pem'