spec/lib/wisper_spec.rb in wisper-1.0.0 vs spec/lib/wisper_spec.rb in wisper-1.0.1

- old
+ new

@@ -60,12 +60,13 @@ publisher.add_listener(listener, :on => 'so_did_this').should == publisher end end describe '.add_block_listener' do + let(:insider) { double('insider') } + it 'subscribes given block to all events' do - insider = double('insider') insider.should_receive(:it_happened).twice publisher.add_block_listener do insider.it_happened end @@ -74,10 +75,9 @@ publisher.send(:broadcast, 'and_so_did_this') end describe ':on argument' do it '.add_block_listener subscribes block to an event' do - insider = double('insider') insider.should_not_receive(:it_happened).once publisher.add_block_listener(:on => 'something_happened') do insider.it_happened end