summaryrefslogtreecommitdiff
path: root/lib/chef/audit
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-12-02 09:30:45 -0800
committertyler-ball <tyleraball@gmail.com>2014-12-17 18:52:20 -0800
commit19f2c6e437642db0c03b193349b13d04636cb8ee (patch)
tree480eb5a24f477881621975d49869b6e78263adea /lib/chef/audit
parent2b3c252f5cad689debce640f01db9705f3c57d22 (diff)
downloadchef-19f2c6e437642db0c03b193349b13d04636cb8ee.tar.gz
Updating to use audit syntax rather than control
Diffstat (limited to 'lib/chef/audit')
-rw-r--r--lib/chef/audit/audit_event_proxy.rb6
-rw-r--r--lib/chef/audit/control_group_data.rb8
-rw-r--r--lib/chef/audit/runner.rb2
3 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/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