Module: MiniTest

Defined in:
lib/minitest/unit.rb,
lib/minitest/mock.rb

Overview

A simple and clean mock object framework.

Defined Under Namespace

Modules: Assertions, Expectations Classes: Assertion, Mock, Skip, Spec, Unit

Constant Summary collapse

MINI_DIR =

'./lib' in project dir, or '/usr/local/blahblah' if installed

File.dirname(File.dirname(file))

Class Method Summary collapse

Class Method Details

.filter_backtrace(bt) ⇒ Object

:nodoc:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/minitest/unit.rb', line 43

def self.filter_backtrace bt # :nodoc:
  return ["No backtrace"] unless bt

  new_bt = []

  unless $DEBUG then
    bt.each do |line|
      break if line.rindex MINI_DIR, 0
      new_bt << line
    end

    new_bt = bt.reject { |line| line.rindex MINI_DIR, 0 } if new_bt.empty?
    new_bt = bt.dup if new_bt.empty?
  else
    new_bt = bt.dup
  end

  new_bt
end