module Test::Unit::TestCaseNotificationSupport

Public Class Methods

included(base) click to toggle source
# File lib/test/unit/notification.rb, line 58
def included(base)
  base.class_eval do
    include NotificationHandler
  end
end

Public Instance Methods

notify(message, options={}, &block) click to toggle source

Notify some information.

Example:

def test_notification
  notify("I'm here!")
  # Reached here
  notify("Special!") if special_case?
  # Reached here too
end

options:

:backtrace override backtrace.
# File lib/test/unit/notification.rb, line 77
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

Private Instance Methods

add_notification(notification) click to toggle source
# File lib/test/unit/notification.rb, line 85
def add_notification(notification)
  current_result.add_notification(notification)
end