spec/lib/integration_spec.rb in wisper-1.5.0 vs spec/lib/integration_spec.rb in wisper-1.6.0
- old
+ new
@@ -17,37 +17,24 @@
listener = double('listener')
expect(listener).to receive(:success).with('hello')
command = MyCommand.new
- command.add_listener(listener)
+ command.subscribe(listener)
command.execute(true)
end
- it 'subscribes block to all published events' do
- insider = double('Insider')
- expect(insider).to receive(:render).with('hello')
-
- command = MyCommand.new
-
- command.add_block_listener do |message|
- insider.render(message)
- end
-
- command.execute(true)
- end
-
it 'maps events to different methods' do
listener_1 = double('listener')
listener_2 = double('listener')
expect(listener_1).to receive(:happy_days).with('hello')
expect(listener_2).to receive(:sad_days).with('world')
command = MyCommand.new
- command.add_listener(listener_1, :on => :success, :with => :happy_days)
- command.add_listener(listener_2, :on => :failure, :with => :sad_days)
+ command.subscribe(listener_1, :on => :success, :with => :happy_days)
+ command.subscribe(listener_2, :on => :failure, :with => :sad_days)
command.execute(true)
command.execute(false)
end