Module: Test::Unit::BrassAssertionHandler

Included in:
TestCase
Defined in:
lib/brass/adapters/testunit.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



6
7
8
# File 'lib/brass/adapters/testunit.rb', line 6

def included(base)
  base.exception_handler(:handle_brass_assertion_failed_error)
end

Instance Method Details

#add_brass_failure(message, backtrace, options = {}) ⇒ Object (private)



25
26
27
28
# File 'lib/brass/adapters/testunit.rb', line 25

def add_brass_failure(message, backtrace, options={})
  failure = Failure.new(name, filter_backtrace(backtrace), message, options)
  current_result.add_failure(failure)
end

#handle_brass_assertion_failed_error(exception) ⇒ Object (private)



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/brass/adapters/testunit.rb', line 12

def handle_brass_assertion_failed_error(exception)
  return false unless exception.assertion?
  problem_occurred
  #parameters = exception.parameters    # TODO: assertion parameters
  add_brass_failure exception.message, exception.backtrace,
              #:expected => exception.expected,
              #:actual => exception.actual,
              #:inspected_expected => exception.inspected_expected,
              #:inspected_actual => exception.inspected_actual,
              :user_message => exception.message #exception.user_message
  true
end