module MiniTest

def self.filter_backtrace bt # :nodoc:

:nodoc:
def self.filter_backtrace bt # :nodoc:
  return ["No backtrace"] unless bt
  new_bt = []
  unless $DEBUG then
    bt.each do |line|
      break if line =~ /lib\/minitest/
      new_bt << line
    end
    new_bt = bt.reject { |line| line =~ /lib\/minitest/ } if new_bt.empty?
    new_bt = bt.dup if new_bt.empty?
  else
    new_bt = bt.dup
  end
  new_bt
end