Module: Test::Unit::TestCaseNotificationSupport
- Included in:
- TestCase
- Defined in:
- lib/test/unit/notification.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#notify(message, &block) ⇒ Object
Notify some information.
Class Method Details
.included(base) ⇒ Object
52 53 54 55 56 |
# File 'lib/test/unit/notification.rb', line 52 def included(base) base.class_eval do include NotificationHandler end end |
Instance Method Details
#notify(message, &block) ⇒ Object
Notify some information.
Example:
def test_notification
notify("I'm here!")
# Reached here
notify("Special!") if special_case?
# Reached here too
end
68 69 70 71 |
# File 'lib/test/unit/notification.rb', line 68 def notify(, &block) notification = Notification.new(name, filter_backtrace(caller), ) add_notification(notification) end |