Class: Minitest::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/brass/adapters/minitest.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#capture_exceptionsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/brass/adapters/minitest.rb', line 7

def capture_exceptions
  yield
rescue *PASSTHROUGH_EXCEPTIONS
  raise
rescue Assertion => e
  self.failures << e
rescue Exception => e
  if e.respond_to?(:assertion?) && e.assertion?
    failure = Assertion.new(e.message)
    failure.set_backtrace(e.backtrace)
    self.failures << failure
  else
    self.failures << UnexpectedError.new(sanitize_exception(e))
  end
end

#capture_exceptions_without_brassObject

Override capture_exceptions to recognize BRASS assertion errors as test failures rather than errors.



5
# File 'lib/brass/adapters/minitest.rb', line 5

alias_method :capture_exceptions_without_brass, :capture_exceptions