summaryrefslogtreecommitdiff
path: root/lib/chef/audit
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2015-01-14 11:40:48 -0800
committerClaire McQuin <claire@getchef.com>2015-01-15 15:34:33 -0800
commit4cbc6274889ddedf105ec99200f53b50439df273 (patch)
treee42d111f7f20f45377f0dbbdeb4e5ef377c9c9f0 /lib/chef/audit
parentd1a70027b68b1ba6d36eea3bc38d5441a61f22f8 (diff)
downloadchef-4cbc6274889ddedf105ec99200f53b50439df273.tar.gz
Update DSL method name to controls_group.mcquin/control_group
Update to use control_group. Unify wording along control_group. Unify wording along control_group. Fix typo. Enable audit mode. Update to use control_group syntax. Update for audit DSL changes. Update for audit DSL change.
Diffstat (limited to 'lib/chef/audit')
-rw-r--r--lib/chef/audit/audit_event_proxy.rb8
-rw-r--r--lib/chef/audit/runner.rb18
2 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 2512b8bfe2..b9ca39e5dc 100644
--- a/lib/chef/audit/audit_event_proxy.rb
+++ b/lib/chef/audit/audit_event_proxy.rb
@@ -35,15 +35,15 @@ class Chef
def example_group_started(notification)
if notification.group.parent_groups.size == 1
- # top level `controls` block
+ # top level `control_group` block
desc = notification.group.description
- Chef::Log.debug("Entered `controls` block named #{desc}")
+ Chef::Log.debug("Entered `control_group` 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 `control_group` blocks and contained examples")
notification.examples.each do |example|
control_group_name, control_data = build_control_from(example)
e = example.exception
@@ -75,7 +75,7 @@ class Chef
group = group[:parent_example_group]
end
- # We know all of our examples each live in a top-level `controls` block - get this name now
+ # We know all of our examples each live in a top-level `control_group` block - get this name now
outermost_group_desc = describe_groups.shift
return outermost_group_desc, {
diff --git a/lib/chef/audit/runner.rb b/lib/chef/audit/runner.rb
index 7ef17a4301..e7d1657d69 100644
--- a/lib/chef/audit/runner.rb
+++ b/lib/chef/audit/runner.rb
@@ -29,7 +29,7 @@ class Chef
def run
setup
- register_controls
+ register_control_groups
do_run
end
@@ -136,29 +136,29 @@ class Chef
Specinfra.configuration.backend = :exec
end
- # Iterates through the controls registered to this run_context, builds an
- # example group (RSpec::Core::ExampleGroup) object per controls, and
+ # Iterates through the control groups registered to this run_context, builds an
+ # example group (RSpec::Core::ExampleGroup) object per control group, and
# registers the group with the RSpec.world.
#
# We could just store an array of example groups and not use RSpec.world,
# but it may be useful later if we decide to apply our own ordering scheme
# or use example group filters.
- def register_controls
+ def register_control_groups
add_example_group_methods
run_context.audits.each do |name, group|
- ctl_grp = RSpec::Core::ExampleGroup.__controls__(*group.args, &group.block)
+ ctl_grp = RSpec::Core::ExampleGroup.__control_group__(*group.args, &group.block)
RSpec.world.register(ctl_grp)
end
end
# Add example group method aliases to RSpec.
#
- # __controls__: Used internally to create example groups from the controls
- # saved in the run_context.
- # control: Used within the context of a controls block, like RSpec's
+ # __control_group__: Used internally to create example groups from the control
+ # groups saved in the run_context.
+ # control: Used within the context of a control group block, like RSpec's
# describe or context.
def add_example_group_methods
- RSpec::Core::ExampleGroup.define_example_group_method :__controls__
+ RSpec::Core::ExampleGroup.define_example_group_method :__control_group__
RSpec::Core::ExampleGroup.define_example_group_method :control
end