diff options
-rw-r--r-- | lib/chef/audit/audit_event_proxy.rb | 6 | ||||
-rw-r--r-- | lib/chef/audit/control_group_data.rb | 8 | ||||
-rw-r--r-- | lib/chef/audit/runner.rb | 2 | ||||
-rw-r--r-- | lib/chef/dsl/audit.rb | 4 | ||||
-rw-r--r-- | lib/chef/run_context.rb | 6 |
5 files changed, 13 insertions, 13 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/control_group_data.rb b/lib/chef/audit/control_group_data.rb index e221ae94cc..969d128c1b 100644 --- a/lib/chef/audit/control_group_data.rb +++ b/lib/chef/audit/control_group_data.rb @@ -28,19 +28,19 @@ class Chef end class ControlGroupData - attr_reader :name, :status, :number_success, :number_failed, :controls + attr_reader :name, :status, :number_succeeded, :number_failed, :controls def initialize(name) @status = "success" @controls = [] - @number_success = 0 + @number_succeeded = 0 @number_failed = 0 @name = name end def example_success(control_data) - @number_success += 1 + @number_succeeded += 1 control = create_control(control_data) control.status = "success" controls << control @@ -64,7 +64,7 @@ class Chef h = { :name => name, :status => status, - :number_success => number_success, + :number_succeeded => number_succeeded, :number_failed => number_failed, :controls => controls.collect { |c| c.to_hash } } diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb index a290dd6607..df6b6d682f 100644 --- a/lib/chef/audit/runner.rb +++ b/lib/chef/audit/runner.rb @@ -143,7 +143,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..a261d38f33 100644 --- a/lib/chef/dsl/audit.rb +++ b/lib/chef/dsl/audit.rb @@ -30,11 +30,11 @@ class Chef name = args[0] if name.nil? || name.empty? raise Chef::Exceptions::AuditNameMissing - elsif run_context.controls.has_key?(name) + elsif run_context.audits.has_key?(name) 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 |