diff options
author | Kyleen <kmacgugan@chef.io> | 2015-03-03 11:33:05 -0800 |
---|---|---|
committer | Kyleen <kmacgugan@chef.io> | 2015-03-03 11:33:05 -0800 |
commit | 3eb33e32034583b02181fb7bd5e28c11c5c5d6e8 (patch) | |
tree | 1bb5a3265b1ed97d1221b0d57e2f3e6ba06fb81c /spec | |
parent | 208c83ffed15ea8379244fba750dc31a39572fd5 (diff) | |
parent | cd8df9a5c54011208320b01d0cbd49da9c5a2dcf (diff) | |
download | chef-3eb33e32034583b02181fb7bd5e28c11c5c5d6e8.tar.gz |
Merge pull request #3001 from chef/kyleen/audit-exclusion
Add /lib/chef/ to backtrace exclusion patterns for audit mode
Diffstat (limited to 'spec')
-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 |