summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-12-02 09:30:45 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-02 09:30:45 -0800
commit750310197330abba1c89580bbc91bfe1d892251b (patch)
tree40c2bc862fcdb0a31da1019b61ee3860848de096
parentbc057ce49580245f69d372e1daf7cf565245cbcf (diff)
downloadchef-tball/audit-semantics.tar.gz
Updating to use audit syntax rather than controltball/audit-semantics
-rw-r--r--lib/chef/audit/audit_event_proxy.rb6
-rw-r--r--lib/chef/audit/runner.rb2
-rw-r--r--lib/chef/dsl/audit.rb2
-rw-r--r--lib/chef/run_context.rb6
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/audit/audit_event_proxy.rb b/lib/chef/audit/audit_event_proxy.rb
index 71d1e2aa50..6d5591d943 100644
--- a/lib/chef/audit/audit_event_proxy.rb
+++ b/lib/chef/audit/audit_event_proxy.rb
@@ -17,15 +17,15 @@ class Chef
def example_group_started(notification)
if notification.group.parent_groups.size == 1
- # top level controls block
+ # top level `controls` block
desc = notification.group.description
- Chef::Log.debug("Entered controls block named #{desc}")
+ Chef::Log.debug("Entered `controls` block named #{desc}")
events.control_group_started(desc)
end
end
def stop(notification)
- Chef::Log.info("Successfully executed all controls blocks and contained examples")
+ Chef::Log.info("Successfully executed all `controls` blocks and contained examples")
notification.examples.each do |example|
control_group_name, control_data = build_control_from(example)
e = example.exception
diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb
index 2c72e6f11f..306212989a 100644
--- a/lib/chef/audit/runner.rb
+++ b/lib/chef/audit/runner.rb
@@ -141,7 +141,7 @@ class Chef
# or use example group filters.
def register_controls
add_example_group_methods
- run_context.controls.each do |name, group|
+ run_context.audits.each do |name, group|
ctl_grp = RSpec::Core::ExampleGroup.__controls__(*group[:args], &group[:block])
RSpec.world.register(ctl_grp)
end
diff --git a/lib/chef/dsl/audit.rb b/lib/chef/dsl/audit.rb
index e22c38f587..a11d9039ef 100644
--- a/lib/chef/dsl/audit.rb
+++ b/lib/chef/dsl/audit.rb
@@ -34,7 +34,7 @@ class Chef
raise Chef::Exceptions::AuditControlGroupDuplicate.new(name)
end
- run_context.controls[name] = { :args => args, :block => block }
+ run_context.audits[name] = { :args => args, :block => block }
end
end
diff --git a/lib/chef/run_context.rb b/lib/chef/run_context.rb
index a724789d3c..d14035da2f 100644
--- a/lib/chef/run_context.rb
+++ b/lib/chef/run_context.rb
@@ -50,8 +50,8 @@ class Chef
# recipes, which is triggered by #load. (See also: CookbookCompiler)
attr_accessor :resource_collection
- # The list of control groups to execute during the audit phase
- attr_accessor :controls
+ # The list of audits (control groups) to execute during the audit phase
+ attr_accessor :audits
# A Hash containing the immediate notifications triggered by resources
# during the converge phase of the chef run.
@@ -76,7 +76,7 @@ class Chef
@node = node
@cookbook_collection = cookbook_collection
@resource_collection = Chef::ResourceCollection.new
- @controls = {}
+ @audits = {}
@immediate_notification_collection = Hash.new {|h,k| h[k] = []}
@delayed_notification_collection = Hash.new {|h,k| h[k] = []}
@definitions = Hash.new