aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/test/notifications_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index e28560d88b..119062d5bf 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -41,6 +41,18 @@ module Notifications
assert_operator event.idle_time, :>, 0
assert_operator event.duration, :>, 0
end
+
+ def test_subscribe_via_subscribe_method
+ events = []
+ @notifier.subscribe do |event|
+ events << event
+ end
+
+ ActiveSupport::Notifications.instrument("foo")
+ event = events.first
+ assert event, "should have an event"
+ assert_operator event.allocations, :>, 0
+ end
end
class SubscribedTest < TestCase