Skip to content

Commit e97c50f

Browse files
author
sanfrancrisko
authored
Merge pull request puppetlabs#431 from puppetlabs/backtrace-cleanup
Cleanup backtrace in spec tests
2 parents 135398a + 31cd737 commit e97c50f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

moduleroot/spec/spec_helper.rb.erb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ RSpec.configure do |c|
6262
RSpec::Puppet::Coverage.report!(<%= @configs['minimum_code_coverage_percentage'] %>)
6363
<%- end -%>
6464
end
65+
66+
# Filter backtrace noise
67+
backtrace_exclusion_patterns = [
68+
%r{spec_helper},
69+
%r{gems},
70+
]
71+
72+
if c.respond_to?(:backtrace_exclusion_patterns)
73+
c.backtrace_exclusion_patterns = backtrace_exclusion_patterns
74+
elsif c.respond_to?(:backtrace_clean_patterns)
75+
c.backtrace_clean_patterns = backtrace_exclusion_patterns
76+
end
6577
end
6678

6779
# Ensures that a module is defined

0 commit comments

Comments
 (0)