Module: Test::Unit::TestCaseNotificationSupport
- Included in:
- TestCase
- Defined in:
- lib/test/unit/notification.rb
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (Object) notify(message, options = {}, &block)
Notify some information.
Class Method Details
+ (Object) included(base)
58 59 60 61 62 |
# File 'lib/test/unit/notification.rb', line 58 def included(base) base.class_eval do include NotificationHandler end end |
Instance Method Details
- (Object) 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.
77 78 79 80 81 82 |
# File 'lib/test/unit/notification.rb', line 77 def notify(, ={}, &block) backtrace = filter_backtrace([:backtrace] || caller) notification = Notification.new(name, backtrace, , :method_name => @method_name) add_notification(notification) end |