module Maxitest::Timeout

def run(*, &block)

def run(*, &block)
  # NOTE: having a default def maxitest_timeout would break using let(:maxitest_timeout)
  timeout = (defined?(maxitest_timeout) ? maxitest_timeout : Maxitest.timeout || 5)
  if timeout == false
    super
  else
    begin
      ::Timeout.timeout(timeout, TestCaseTimeout) { super }
    rescue TestCaseTimeout => e
      failures << UnexpectedError.new(e)
    end
  end
end