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.1.0"

Instance Method Summary collapse

Instance Method Details

#assert(test, msg = nil) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/minitest/debugger.rb', line 30

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