summaryrefslogtreecommitdiff
path: root/lib/chef/dsl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/dsl')
-rw-r--r--lib/chef/dsl/audit.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb
index 42a1927efb..1849b65633 100644
--- a/lib/chef/dsl/audit.rb
+++ b/lib/chef/dsl/audit.rb
@@ -29,6 +29,8 @@ class Chef
# Adds the controls group and block (containing controls to execute) to the runner's list of pending examples
def controls(*args, &block)
raise ::Chef::Exceptions::NoAuditsProvided unless block
+ name = args[0]
+ raise AuditNameMissing if name.nil? || name.empty?
run_context.controls_groups << ::RSpec::Core::ExampleGroup.__controls__(*args, &block)
end