summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/audit/audit_event_proxy_spec.rb4
-rw-r--r--spec/unit/audit/runner_spec.rb8
-rw-r--r--spec/unit/dsl/audit_spec.rb8
-rw-r--r--spec/unit/recipe_spec.rb2
4 files changed, 11 insertions, 11 deletions
diff --git a/spec/unit/audit/audit_event_proxy_spec.rb b/spec/unit/audit/audit_event_proxy_spec.rb
index 899ba468b1..17a5d3d771 100644
--- a/spec/unit/audit/audit_event_proxy_spec.rb
+++ b/spec/unit/audit/audit_event_proxy_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Audit::AuditEventProxy do
it "notifies control_group_started event" do
expect(Chef::Log).to receive(:debug).
- with("Entered \`controls\` block named poots")
+ with("Entered \`control_group\` block named poots")
expect(events).to receive(:control_group_started).
with(description)
audit_event_proxy.example_group_started(notification)
@@ -76,7 +76,7 @@ describe Chef::Audit::AuditEventProxy do
end
it "sends a message that audits completed" do
- expect(Chef::Log).to receive(:info).with("Successfully executed all \`controls\` blocks and contained examples")
+ expect(Chef::Log).to receive(:info).with("Successfully executed all \`control_group\` blocks and contained examples")
audit_event_proxy.stop(notification)
end
diff --git a/spec/unit/audit/runner_spec.rb b/spec/unit/audit/runner_spec.rb
index 67590fecf9..250c93b24d 100644
--- a/spec/unit/audit/runner_spec.rb
+++ b/spec/unit/audit/runner_spec.rb
@@ -76,14 +76,14 @@ describe Chef::Audit::Runner do
end
end
- describe "#register_controls" do
+ describe "#register_control_groups" do
let(:audits) { [] }
let(:run_context) { instance_double(Chef::RunContext, :audits => audits) }
it "adds the control group aliases" do
- runner.send(:register_controls)
+ runner.send(:register_control_groups)
- expect(RSpec::Core::DSL.example_group_aliases).to include(:__controls__)
+ expect(RSpec::Core::DSL.example_group_aliases).to include(:__control_group__)
expect(RSpec::Core::DSL.example_group_aliases).to include(:control)
end
@@ -92,7 +92,7 @@ describe Chef::Audit::Runner do
let(:group) {Struct.new(:args, :block).new(["group_name"], nil)}
it "sends the audits to the world" do
- runner.send(:register_controls)
+ runner.send(:register_control_groups)
expect(RSpec.world.example_groups.size).to eq(1)
# For whatever reason, `kind_of` is not working
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb
index 38707127f0..28b28e0a7c 100644
--- a/spec/unit/dsl/audit_spec.rb
+++ b/spec/unit/dsl/audit_spec.rb
@@ -17,18 +17,18 @@ describe Chef::DSL::Audit do
let(:cookbook_collection) { {} }
it "raises an error when a block of audits is not provided" do
- expect{ auditor.controls "name" }.to raise_error(Chef::Exceptions::NoAuditsProvided)
+ expect{ auditor.control_group "name" }.to raise_error(Chef::Exceptions::NoAuditsProvided)
end
it "raises an error when no audit name is given" do
- expect{ auditor.controls do end }.to raise_error(Chef::Exceptions::AuditNameMissing)
+ expect{ auditor.control_group do end }.to raise_error(Chef::Exceptions::AuditNameMissing)
end
context "audits already populated" do
let(:audits) { {"unique" => {} } }
it "raises an error if the audit name is a duplicate" do
- expect { auditor.controls "unique" do end }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
+ expect { auditor.control_group "unique" do end }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate)
end
end
@@ -36,7 +36,7 @@ describe Chef::DSL::Audit do
let(:auditor) { BadAuditDSLTester.new }
it "fails because it relies on the recipe DSL existing" do
- expect { auditor.controls "unique" do end }.to raise_error(NoMethodError, /undefined method `cookbook_name'/)
+ expect { auditor.control_group "unique" do end }.to raise_error(NoMethodError, /undefined method `cookbook_name'/)
end
end
diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb
index 22389a1a82..74feb984a5 100644
--- a/spec/unit/recipe_spec.rb
+++ b/spec/unit/recipe_spec.rb
@@ -563,7 +563,7 @@ describe Chef::Recipe do
describe "included DSL" do
it "should include features from Chef::DSL::Audit" do
expect(recipe.singleton_class.included_modules).to include(Chef::DSL::Audit)
- expect(recipe.respond_to?(:controls)).to be true
+ expect(recipe.respond_to?(:control_group)).to be true
end
end
end