diff options
author | Kyleen MacGugan <kmacgugan@chef.io> | 2015-03-02 13:25:26 -0800 |
---|---|---|
committer | Kyleen MacGugan <kmacgugan@chef.io> | 2015-03-03 09:48:48 -0800 |
commit | cd8df9a5c54011208320b01d0cbd49da9c5a2dcf (patch) | |
tree | 74fe96c257f2b303e00f9677ea01e7c76643448a /spec/unit/audit | |
parent | c2dfb56e730214266ae07a57a56e5889b1e6b85b (diff) | |
download | chef-cd8df9a5c54011208320b01d0cbd49da9c5a2dcf.tar.gz |
Add /lib/chef/ to backtrace exclusion patterns for audit modekyleen/audit-exclusion
Exclusion pattern now includes anything with /lib/chef/ only
fix spacing issue
Diffstat (limited to 'spec/unit/audit')
-rw-r--r-- | spec/unit/audit/runner_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/unit/audit/runner_spec.rb b/spec/unit/audit/runner_spec.rb index 801147bdb9..10d8a645a7 100644 --- a/spec/unit/audit/runner_spec.rb +++ b/spec/unit/audit/runner_spec.rb @@ -36,6 +36,15 @@ describe Chef::Audit::Runner do RSpec::Core::Sandbox.sandboxed { ex.run } end + context "when we run in audit mode" do + paths = [ "/opt/chef/lib/chef/", 'C:\windows/here/lib/chef/' , "/opt/chef/extra/folders/lib/chef/"] + it "excludes the current path from backtrace" do + paths.each do |path| + expect(runner.exclusion_pattern).to match(path) + end + end + end + describe "#initialize" do it "correctly sets the run_context during initialization" do expect(runner.instance_variable_get(:@run_context)).to eq(run_context) @@ -72,6 +81,7 @@ describe Chef::Audit::Runner do expect(RSpec.configuration.color).to eq(color) expect(RSpec.configuration.expose_dsl_globally?).to eq(false) + expect(RSpec.configuration.backtrace_exclusion_patterns).to include(runner.exclusion_pattern) expect(Specinfra.configuration.backend).to eq(:exec) end |