模块 Test::Unit::TestCaseNotificationSupport

公共类方法

included(base) 点击切换源代码
# File test-unit-3.6.7/lib/test/unit/notification.rb, line 58
def included(base)
  base.class_eval do
    include NotificationHandler
  end
end

公共实例方法

notify(message, options={}, &block) 点击切换源代码

通知一些信息。

示例

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

选项

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

私有实例方法

add_notification(notification) 点击切换源代码
# File test-unit-3.6.7/lib/test/unit/notification.rb, line 87
def add_notification(notification)
  current_result.add_notification(notification)
end