123456789_123456789_123456789_123456789_123456789_

Module: Test::Unit::TestCaseNotificationSupport

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
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 58

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

Instance Method Details

#add_notification(notification) (private)

[ GitHub ]

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

def add_notification(notification)
  current_result.add_notification(notification)
end

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

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.
[ GitHub ]

  
# File '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