diff options
author | Davida Marion <davidamarion@gmail.com> | 2015-05-21 15:36:00 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2015-05-29 08:41:12 -0700 |
commit | 676342c040a2e282425648e6e833047c048fea7b (patch) | |
tree | 36957679f2f781b69a41bdb801d6f72aa6404188 /spec/support | |
parent | 3e1cbd6856eda733a1ed800184d8545e5d070e8e (diff) | |
download | chef-676342c040a2e282425648e6e833047c048fea7b.tar.gz |
adding unit tests
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared/context/client.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/support/shared/context/client.rb b/spec/support/shared/context/client.rb index e625185f7c..f5c21a3c65 100644 --- a/spec/support/shared/context/client.rb +++ b/spec/support/shared/context/client.rb @@ -201,6 +201,7 @@ shared_context "audit phase completed" do def stub_for_audit # -- Client#run_audits expect(Chef::Audit::Runner).to receive(:new).and_return(audit_runner) + expect(Chef::Audit::Logger).to receive(:read_buffer).and_return("Audit mode output!") expect(audit_runner).to receive(:run).and_return(true) expect(client.events).to receive(:audit_phase_complete) end @@ -215,6 +216,7 @@ shared_context "audit phase failed with error" do def stub_for_audit expect(Chef::Audit::Runner).to receive(:new).and_return(audit_runner) + expect(Chef::Audit::Logger).to receive(:read_buffer).and_return("Audit mode output!") expect(audit_runner).to receive(:run).and_raise(audit_error) expect(client.events).to receive(:audit_phase_failed).with(audit_error) end @@ -232,6 +234,7 @@ shared_context "audit phase completed with failed controls" do def stub_for_audit expect(Chef::Audit::Runner).to receive(:new).and_return(audit_runner) + expect(Chef::Audit::Logger).to receive(:read_buffer).and_return("Audit mode output!") expect(audit_runner).to receive(:run) expect(Chef::Exceptions::AuditsFailed).to receive(:new).with( audit_runner.num_failed, audit_runner.num_total |