Methods
T
Instance Public methods
test_events_are_published_to_a_listener()
    # File activesupport/test/notifications_test.rb
171 def test_events_are_published_to_a_listener
172   @notifier.publish :foo
173   @notifier.wait
174   assert_equal [[:foo]], @events
175 end
test_log_subscriber_with_pattern()
    # File activesupport/test/notifications_test.rb
211 def test_log_subscriber_with_pattern
212   events = []
213   @notifier.subscribe(/\d/) { |*args| events << args }
214 
215   @notifier.publish "1"
216   @notifier.publish "a.1"
217   @notifier.publish "1.a"
218   @notifier.wait
219 
220   assert_equal [["1"], ["a.1"], ["1.a"]], events
221 end
test_log_subscriber_with_string()
    # File activesupport/test/notifications_test.rb
199 def test_log_subscriber_with_string
200   events = []
201   @notifier.subscribe("1") { |*args| events << args }
202 
203   @notifier.publish "1"
204   @notifier.publish "1.a"
205   @notifier.publish "a.1"
206   @notifier.wait
207 
208   assert_equal [["1"]], events
209 end
test_multiple_log_subscribers()
    # File activesupport/test/notifications_test.rb
223 def test_multiple_log_subscribers
224   @another = []
225   @notifier.subscribe { |*args| @another << args }
226   @notifier.publish :foo
227   @notifier.wait
228 
229   assert_equal [[:foo]], @events
230   assert_equal [[:foo]], @another
231 end
test_publish_with_subscriber()
    # File activesupport/test/notifications_test.rb
233 def test_publish_with_subscriber
234   subscriber = TestSubscriber.new
235   @notifier.subscribe nil, subscriber
236   @notifier.publish :foo
237 
238   assert_equal [[:foo]], subscriber.publishes
239 end
test_publishing_after_a_new_subscribe_works()
    # File activesupport/test/notifications_test.rb
184 def test_publishing_after_a_new_subscribe_works
185   @notifier.publish :foo
186   @notifier.publish :foo
187 
188   @notifier.subscribe("not_existent") do |*args|
189     @events << ActiveSupport::Notifications::Event.new(*args)
190   end
191 
192   @notifier.publish :foo
193   @notifier.publish :foo
194   @notifier.wait
195 
196   assert_equal [[:foo]] * 4, @events
197 end
test_publishing_multiple_times_works()
    # File activesupport/test/notifications_test.rb
177 def test_publishing_multiple_times_works
178   @notifier.publish :foo
179   @notifier.publish :foo
180   @notifier.wait
181   assert_equal [[:foo], [:foo]], @events
182 end