Module: PubSub::Testing::SubscriptionsHelper

Defined in:
lib/pub_sub/testing/subscription_helpers.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.clear_wisper_subscriptions!Object



17
18
19
20
# File 'lib/pub_sub/testing/subscription_helpers.rb', line 17

def clear_wisper_subscriptions!
  PubSub.subscriptions.clear!
  subscribe_logger!
end

.subscribe_logger!Object



12
13
14
# File 'lib/pub_sub/testing/subscription_helpers.rb', line 12

def subscribe_logger!
  PubSub.subscriptions.register(:logging)
end

Instance Method Details

#with_subscription_to(*domains) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/pub_sub/testing/subscription_helpers.rb', line 4

def with_subscription_to(*domains)
  domains.each do |domain|
    PubSub.subscriptions.register(domain)
  end
  yield
  clear_wisper_subscriptions!
end