diff options
Diffstat (limited to 'spec/unit/provider/execute_spec.rb')
-rw-r--r-- | spec/unit/provider/execute_spec.rb | 9 |
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 |