Sha256: 8b1fc407c19b305fd7d1e815988d3d6620e3ba5223c777a820624a9d453847a8

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

describe BunnyMock::Exchanges::Fanout do

	context '#deliver' do

		before do
			@source = @channel.fanout 'xchg.source'

			@first = @channel.queue 'queue.first'
			@second = @channel.queue 'queue.second'
			@third = @channel.queue 'queue.third'

			@first.bind @source
			@second.bind @source
			@third.bind @source
		end

		it 'should only deliver to all routes' do
			@source.publish 'Testing message', routing_key: 'queue.second'

			expect(@first.message_count).to eq(1)
			expect(@first.pop[:message]).to eq('Testing message')

			expect(@second.message_count).to eq(1)
			expect(@second.pop[:message]).to eq('Testing message')

			expect(@third.message_count).to eq(1)
			expect(@third.pop[:message]).to eq('Testing message')
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bunny-mock-1.3.0 spec/unit/bunny_mock/exchanges/fanout_spec.rb
bunny-mock-1.2.2 spec/unit/bunny_mock/exchanges/fanout_spec.rb
bunny-mock-1.2.1 spec/unit/bunny_mock/exchanges/fanout_spec.rb