Module: Mini

Defined in:
lib/mini/test.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, Spec, Test

Constant Summary collapse

MINI_DIR =
File.dirname(File.dirname(file))

Class Method Summary collapse

Class Method Details

.filter_backtrace(bt) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/mini/test.rb', line 22

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

  new_bt = []
  bt.each do |line|
    break if line.index(MINI_DIR) == 0
    new_bt << line
  end

  new_bt = bt.reject { |line| line.index(MINI_DIR) == 0 } if
    new_bt.empty?
  new_bt = bt.dup if new_bt.empty?

  new_bt
end