module Maxitest::InterruptHandler
def capture_exceptions(&block)
def capture_exceptions(&block) super(&block) rescue Interrupt => e Maxitest.interrupted = true failures << Minitest::UnexpectedError.new(e) end
def run
def run if Maxitest.interrupted # produce a real error so we do not crash in -v mode failures << begin raise Minitest::Skip, 'Maxitest::Interrupted' rescue Minitest::Skip $! end result = Minitest::Result.from(self) result.time = 0 result else super() end end