module Test::Unit::TestCaseNotificationSupport
def add_notification(notification)
def add_notification(notification) current_result.add_notification(notification) end
def included(base)
def included(base) base.class_eval do include NotificationHandler end end
def notify(message, options={}, &block)
options:
end
# Reached here too
notify("Special!") if special_case?
# Reached here
notify("I'm here!")
def test_notification
Example:
Notify some information.
def notify(message, options={}, &block) backtrace = filter_backtrace(options[:backtrace] || caller) notification = Notification.new(name, backtrace, message, :method_name => @method_name) add_notification(notification) end