123456789_123456789_123456789_123456789_123456789_

Module: Test::Unit::NotificationHandler

Relationships & Source Files
Defined in: lib/test/unit/notification.rb

Class Method Summary

Instance Method Summary

Class Method Details

.included(base)

[ GitHub ]

  
# File 'lib/test/unit/notification.rb', line 92

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

Instance Method Details

#handle_notified_error(exception) (private)

[ GitHub ]

  
# File 'lib/test/unit/notification.rb', line 98

def handle_notified_error(exception)
  return false unless exception.is_a?(NotifiedError)
  notification = Notification.new(name,
                                  filter_backtrace(exception.backtrace),
                                  exception.message)
  add_notification(notification)
  true
end