Module: Minitest::Debugger

Included in:
Test
Defined in:
lib/minitest/debugger.rb

Overview

This is a stupid simple example of how easy it is to make a minitest plugin that does something useful. In this case it wraps assert so that failed assertions will drop into the ruby debugger.

Constant Summary collapse

VERSION =
"1.0.3"

Instance Method Summary collapse

Instance Method Details

#assert(test, msg = nil) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/minitest/debugger.rb', line 33

def assert test, msg = nil
  begin
    super
  rescue Minitest::Assertion => e
    warn "Assertion Failed. Dropping into debugger now:"
    DEBUGGER__.interrupt
    raise e
  end
end