Module: MiniTest

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

Overview

Totally minimal drop-in replacement for test-unit

TODO: refute -> debunk, prove/rebut, show/deny… lots of possibilities

Defined Under Namespace

Modules: Assertions 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



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/minitest/unit.rb', line 26

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

  new_bt = []
  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?
  new_bt
end