summaryrefslogtreecommitdiff
path: root/spec/unit/dsl
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-11-21 10:10:56 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-17 18:52:20 -0800
commit2b3c252f5cad689debce640f01db9705f3c57d22 (patch)
treede4db8a14ddfa8c850dbd76965b464d30925e170 /spec/unit/dsl
parentb6804bbe2e8fd90a958db3685da92b3112c29536 (diff)
downloadchef-2b3c252f5cad689debce640f01db9705f3c57d22.tar.gz
Test including supported serverspec helpers. Updates per PR comments.
Diffstat (limited to 'spec/unit/dsl')
-rw-r--r--spec/unit/dsl/audit_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb
new file mode 100644
index 0000000000..7ddffb4e9f
--- /dev/null
+++ b/spec/unit/dsl/audit_spec.rb
@@ -0,0 +1,24 @@
+
+require 'spec_helper'
+require 'chef/dsl/audit'
+
+class AuditDSLTester
+ include Chef::DSL::Audit
+end
+
+describe Chef::DSL::Audit do
+ let(:auditor) { AuditDSLTester.new }
+
+ it "raises an error when a block of audits is not provided" do
+ expect{ auditor.controls "name" }.to raise_error(Chef::Exceptions::NoAuditsProvided)
+ end
+
+ it "raises an error when no audit name is given" do
+ expect{ auditor.controls do end }.to raise_error(Chef::Exceptions::AuditNameMissing)
+ end
+
+ it "raises an error if the audit name is a duplicate" do
+ auditor.controls "unique" do end
+ expect { auditor.controls "unique" do end }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
+ end
+end