summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-12-08 16:17:30 -0800
committerClaire McQuin <claire@getchef.com>2014-12-08 16:17:30 -0800
commitef40a662c42f343d40da394186a4e26f8008a692 (patch)
tree1b2d703cdcd97f295b00890910f26ac68db87b54 /spec/unit/dsl
parent470de0972fbb30841107c3c51255800ffccde7d2 (diff)
downloadchef-ef40a662c42f343d40da394186a4e26f8008a692.tar.gz
Update for audit-mode changes.
Diffstat (limited to 'spec/unit/dsl')
-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