class Minitest::BacktraceFilter

def filter bt

def filter bt
  return ["No backtrace"] unless bt
  return bt.dup if $DEBUG || ENV["MT_DEBUG"]
  new_bt = bt.take_while { |line| line.to_s !~ regexp }
  new_bt = bt.select     { |line| line.to_s !~ regexp } if new_bt.empty?
  new_bt = bt.dup                                       if new_bt.empty?
  new_bt
end

def initialize regexp = MT_RE

def initialize regexp = MT_RE
  self.regexp = regexp
end