spec/models/concerns/subscribable_spec.rb in reactor-0.4.7 vs spec/models/concerns/subscribable_spec.rb in reactor-0.5.0

- old
+ new

@@ -7,10 +7,13 @@ end on_event :puppy_delivered, :ring_bell on_event :any_event, -> (event) { puppies! } on_event :pooped, :pick_up_poop, delay: 5.minutes + on_event '*' do |event| + event.actor.more_puppies! if event.name == 'another_event' + end def self.ring_bell(event) pp "ring ring! #{event}" end end @@ -40,7 +43,12 @@ it 'binds proc' do Auction.should_receive(:puppies!) Reactor::Event.publish(:any_event) end + + it 'accepts wildcard event name' do + Auction.any_instance.should_receive(:more_puppies!) + Reactor::Event.publish(:another_event, actor: Auction.create) + end end -end \ No newline at end of file +end