Sha256: 02078f9bd20afac05a1e76de1b693547f11c8ff950f3f9094ca5b0dad808010c

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 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.2.0 spec/unit/bunny_mock/exchanges/fanout_spec.rb
bunny-mock-1.1.0 spec/unit/bunny_mock/exchanges/fanout_spec.rb
bunny-mock-1.0.0 spec/unit/bunny_mock/exchanges/fanout_spec.rb