summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-12-02 16:09:35 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-17 18:52:21 -0800
commitb079e015f4ebb8c5db600bd49641699cbbacdb10 (patch)
treefd7d81f983998b228aa8e63875f03c895716fa7a /spec
parent19f2c6e437642db0c03b193349b13d04636cb8ee (diff)
downloadchef-b079e015f4ebb8c5db600bd49641699cbbacdb10.tar.gz
Adding cookbook and recipe information per analytics request
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/dsl/audit_spec.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb
index 7ddffb4e9f..7565a42d58 100644
--- a/spec/unit/dsl/audit_spec.rb
+++ b/spec/unit/dsl/audit_spec.rb
@@ -8,6 +8,12 @@ end
describe Chef::DSL::Audit do
let(:auditor) { AuditDSLTester.new }
+ let(:run_context) { instance_double(Chef::RunContext, :audits => audits) }
+ let(:audits) { [] }
+
+ before do
+ allow(auditor).to receive(:run_context).and_return(run_context)
+ end
it "raises an error when a block of audits is not provided" do
expect{ auditor.controls "name" }.to raise_error(Chef::Exceptions::NoAuditsProvided)
@@ -18,7 +24,7 @@ describe Chef::DSL::Audit do
end
it "raises an error if the audit name is a duplicate" do
- auditor.controls "unique" do end
+ expect(audits).to receive(:has_key?).with("unique").and_return(true)
expect { auditor.controls "unique" do end }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
end
end