From 327545c3ae904d1a9c67de3e280c182ed6418023 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 29 Nov 2009 02:30:35 -0800 Subject: Notifications: synchronous fanout queue pushes events to subscribers rather than having them concurrently pull --- activesupport/test/notifications_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport/test/notifications_test.rb') diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb index 93c61b2c83..4f880d0db7 100644 --- a/activesupport/test/notifications_test.rb +++ b/activesupport/test/notifications_test.rb @@ -71,6 +71,16 @@ module Notifications end end + class SyncPubSubTest < PubSubTest + def setup + Thread.abort_on_exception = true + + @notifier = ActiveSupport::Notifications::Notifier.new(ActiveSupport::Notifications::Fanout.new(true)) + @events = [] + @notifier.subscribe { |*args| @events << event(*args) } + end + end + class InstrumentationTest < TestCase def test_instrument_returns_block_result assert_equal 2, @notifier.instrument(:awesome) { 1 + 1 } -- cgit v1.2.3