Class: Minitest::BacktraceFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#filter(bt) ⇒ Object



783
784
785
786
787
788
789
790
791
792
793
# File 'lib/minitest.rb', line 783

def filter bt
  return ["No backtrace"] unless bt

  return bt.dup if $DEBUG

  new_bt = bt.take_while { |line| line !~ /lib\/minitest/ }
  new_bt = bt.select     { |line| line !~ /lib\/minitest/ } if new_bt.empty?
  new_bt = bt.dup                                           if new_bt.empty?

  new_bt
end