diff options
author | Tim Smith <tsmith@chef.io> | 2018-09-21 15:04:09 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-03-11 12:20:20 -0700 |
commit | df23dbbda7d4eb621804f004ff85181d83a11641 (patch) | |
tree | dc4ac3d354e5b9eb3229ed9be56d5447cc9a1d85 /spec/unit/dsl | |
parent | b870d8c578a6424e405ec2083d5f47d331f09d14 (diff) | |
download | chef-df23dbbda7d4eb621804f004ff85181d83a11641.tar.gz |
WIP: Remove audit mode from chef-client
This just gives us a line count to the change and perhaps a starting
point for when we do this in Chef 15
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/dsl')
-rw-r--r-- | spec/unit/dsl/audit_spec.rb | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/spec/unit/dsl/audit_spec.rb b/spec/unit/dsl/audit_spec.rb deleted file mode 100644 index e24fbc4589..0000000000 --- a/spec/unit/dsl/audit_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ - -require "spec_helper" -require "chef/dsl/audit" - -class AuditDSLTester < Chef::Recipe - include Chef::DSL::Audit -end - -class BadAuditDSLTester - include Chef::DSL::Audit -end - -describe Chef::DSL::Audit do - let(:auditor) { AuditDSLTester.new("cookbook_name", "recipe_name", run_context) } - let(:run_context) { instance_double(Chef::RunContext, audits: audits, cookbook_collection: cookbook_collection) } - let(:audits) { {} } - let(:cookbook_collection) { {} } - - it "raises an error when a block of audits is not provided" do - 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.control_group {} }.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.control_group("unique") {} }.to raise_error(Chef::Exceptions::AuditControlGroupDuplicate) - end - end - - context "included in a class without recipe DSL" do - let(:auditor) { BadAuditDSLTester.new } - - it "fails because it relies on the recipe DSL existing" do - expect { auditor.control_group("unique") {} }.to raise_error(NoMethodError, /undefined method `cookbook_name'/) - end - end - -end |