Module: Test::Unit::TestCaseNotificationSupport

Included in:
TestCase
Defined in:
lib/test/unit/notification.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



56
57
58
59
60
# File 'lib/test/unit/notification.rb', line 56

def included(base)
  base.class_eval do
    include NotificationHandler
  end
end

Instance Method Details

#notify(message, options = {}, &block) ⇒ Object

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.


75
76
77
78
79
# File 'lib/test/unit/notification.rb', line 75

def notify(message, options={}, &block)
  backtrace = filter_backtrace(options[:backtrace] || caller)
  notification = Notification.new(name, backtrace, message)
  add_notification(notification)
end