Methods
T
Instance Public methods
test_unsubscribing_by_name_leaves_regexp_matched_subscriptions()
    # File activesupport/test/notifications_test.rb
131 def test_unsubscribing_by_name_leaves_regexp_matched_subscriptions
132   @matched_events = []
133   @notifier.subscribe(/subscription/) { |*args| @matched_events << event(*args) }
134   @notifier.publish("named.subscription", :before)
135   @notifier.wait
136   [@events, @named_events, @matched_events].each do |collector|
137     assert_includes(collector, ["named.subscription", :before])
138   end
139   @notifier.unsubscribe("named.subscription")
140   @notifier.publish("named.subscription", :after)
141   @notifier.publish("other.subscription", :after)
142   @notifier.wait
143   assert_includes(@events, ["named.subscription", :after])
144   assert_includes(@events, ["other.subscription", :after])
145   assert_includes(@matched_events, ["other.subscription", :after])
146   assert_not_includes(@matched_events, ["named.subscription", :after])
147   assert_not_includes(@named_events, ["named.subscription", :after])
148 end
test_unsubscribing_by_name_leaves_the_other_subscriptions()
    # File activesupport/test/notifications_test.rb
121 def test_unsubscribing_by_name_leaves_the_other_subscriptions
122   @notifier.publish "named.subscription", :foo
123   @notifier.wait
124   assert_equal [["named.subscription", :foo]], @events
125   @notifier.unsubscribe("named.subscription")
126   @notifier.publish "named.subscription", :foo
127   @notifier.wait
128   assert_equal [["named.subscription", :foo], ["named.subscription", :foo]], @events
129 end
test_unsubscribing_by_name_removes_a_subscription()
    # File activesupport/test/notifications_test.rb
111 def test_unsubscribing_by_name_removes_a_subscription
112   @notifier.publish "named.subscription", :foo
113   @notifier.wait
114   assert_equal [["named.subscription", :foo]], @named_events
115   @notifier.unsubscribe("named.subscription")
116   @notifier.publish "named.subscription", :foo
117   @notifier.wait
118   assert_equal [["named.subscription", :foo]], @named_events
119 end
test_unsubscribing_removes_a_subscription()
    # File activesupport/test/notifications_test.rb
101 def test_unsubscribing_removes_a_subscription
102   @notifier.publish :foo
103   @notifier.wait
104   assert_equal [[:foo]], @events
105   @notifier.unsubscribe(@subscription)
106   @notifier.publish :foo
107   @notifier.wait
108   assert_equal [[:foo]], @events
109 end