summaryrefslogtreecommitdiff
path: root/spec/unit/client_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/client_spec.rb')
-rw-r--r--spec/unit/client_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/client_spec.rb b/spec/unit/client_spec.rb
index 10958d628c..eb13efbf76 100644
--- a/spec/unit/client_spec.rb
+++ b/spec/unit/client_spec.rb
@@ -192,6 +192,7 @@ describe Chef::Client do
let(:http_cookbook_sync) { double("Chef::REST (cookbook sync)") }
let(:http_node_save) { double("Chef::REST (node save)") }
let(:runner) { double("Chef::Runner") }
+ let(:audit_runner) { double("Chef::Audit::Runner") }
let(:api_client_exists?) { false }
@@ -253,6 +254,13 @@ describe Chef::Client do
expect_any_instance_of(Chef::ResourceReporter).to receive(:run_completed)
end
+ def stub_for_audit
+ expect(Chef::Audit::Runner).to receive(:new).and_return(audit_runner)
+ expect(audit_runner).to receive(:run).and_return(true)
+
+ expect_any_instance_of(Chef::Audit::AuditReporter).to receive(:audit_phase_complete)
+ end
+
def stub_for_node_save
allow(node).to receive(:data_for_save).and_return(node.for_json)
@@ -282,6 +290,7 @@ describe Chef::Client do
stub_for_node_load
stub_for_sync_cookbooks
stub_for_converge
+ stub_for_audit
stub_for_node_save
stub_for_run
end