summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjib Dey <ranjib@linux.com>2015-09-26 11:55:46 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-24 18:34:53 -0700
commit738be6a59d0539cf5045eb0c58676a4a620a5028 (patch)
tree9e6a948e4c8c3b86cbc97b3b51adf8d70cd0c55a
parentde79955c2b2fdebe177340fc285a9acb66c03a5f (diff)
downloadchef-738be6a59d0539cf5045eb0c58676a4a620a5028.tar.gz
add spec for stdout/stderr suppresion in error of sensitive execute resource
-rw-r--r--spec/unit/provider/execute_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/provider/execute_spec.rb b/spec/unit/provider/execute_spec.rb
index 1274203ce3..e7607d9417 100644
--- a/spec/unit/provider/execute_spec.rb
+++ b/spec/unit/provider/execute_spec.rb
@@ -172,5 +172,14 @@ describe Chef::Provider::Execute do
provider.run_action(:run)
expect(new_resource).to be_updated
end
+
+ it "should not include stdout/stderr in failure exception for sensitive resource" do
+ opts.delete(:live_stream)
+ new_resource.sensitive true
+ expect(provider).to receive(:shell_out!).and_raise(Mixlib::ShellOut::ShellCommandFailed)
+ expect do
+ provider.run_action(:run)
+ end.to raise_error(Mixlib::ShellOut::ShellCommandFailed, /suppressed for sensitive resource/)
+ end
end
end