summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2020-11-13 17:33:55 -0800
committerPete Higgins <pete@peterhiggins.org>2020-12-01 16:12:04 -0800
commit01dee0556aa4d029f547c8d4020e46d09dc6ad79 (patch)
tree55cd29ad3514e10e0fc48998ce51b72423769f47
parenteed12b53bded91aeee33de9f9a76b992d2fd9808 (diff)
downloadchef-01dee0556aa4d029f547c8d4020e46d09dc6ad79.tar.gz
Simplify some test setup.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r--spec/unit/audit/runner_spec.rb8
1 files changed, 0 insertions, 8 deletions
diff --git a/spec/unit/audit/runner_spec.rb b/spec/unit/audit/runner_spec.rb
index 91db3dda91..76326dfbe0 100644
--- a/spec/unit/audit/runner_spec.rb
+++ b/spec/unit/audit/runner_spec.rb
@@ -24,16 +24,12 @@ describe Chef::Audit::Runner do
describe "#enabled?" do
it "is true if the node attributes have audit profiles and the audit cookbook is not present" do
- node.default["audit"] = {}
- node.default["audit"]["profiles"] = {}
node.default["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
expect(runner).to be_enabled
end
it "is false if the node attributes have audit profiles and the audit cookbook is present" do
- node.default["audit"] = {}
- node.default["audit"]["profiles"] = {}
node.default["audit"]["profiles"]["ssh"] = { 'compliance': "base/ssh" }
cookbook_collection["audit"] = double(:audit_cookbook, version: "1.2.3")
@@ -42,14 +38,12 @@ describe Chef::Audit::Runner do
end
it "is false if the node attributes do not have audit profiles and the audit cookbook is not present" do
- node.default["audit"] = {}
node.default["audit"]["profiles"] = {}
expect(runner).not_to be_enabled
end
it "is false if the node attributes do not have audit profiles and the audit cookbook is present" do
- node.default["audit"] = {}
node.default["audit"]["profiles"] = {}
cookbook_collection["audit"] = double(:audit_cookbook, version: "1.2.3")
@@ -64,7 +58,6 @@ describe Chef::Audit::Runner do
describe "#inspec_opts" do
it "accepts a string as a waiver file" do
- node.default["audit"] = {}
node.default["audit"][:waiver_file] = __FILE__
expect(logger).not_to receive(:error)
@@ -73,7 +66,6 @@ describe Chef::Audit::Runner do
end
it "filters out non-existant waiver files" do
- node.default["audit"] = {}
node.default["audit"][:waiver_file] = [__FILE__, "some_other_file"]
expect(logger).to receive(:error).with(/some_other_file is missing/)