Module: RSpec::Core::LegacyBacktraceFormatter

Extended by:
LegacyBacktraceFormatter
Included in:
Formatters::Helpers, LegacyBacktraceFormatter
Defined in:
lib/rspec/legacy_formatters/helpers.rb

Instance Method Summary collapse

Instance Method Details

#format_backtrace(backtrace, options = {}) ⇒ void


6
7
8
9
10
11
12
# File 'lib/rspec/legacy_formatters/helpers.rb', line 6

def format_backtrace(backtrace, options = {})
  return "" unless backtrace
  return backtrace if options[:full_backtrace] == true

  cleansed = backtrace.map { |line| backtrace_line(line) }.compact
  cleansed.empty? ? backtrace : cleansed
end