arempe93 / bunny-mock

A mock client for RabbitMQ modeled after the Bunny client in ruby
http://www.rubydoc.info/github/arempe93/bunny-mock
MIT License
44 stars 37 forks source link

Duplicate Bindings #43

Open verenion opened 5 years ago

verenion commented 5 years ago

If you bind a queue to an exchange multiple times, then publish a message to the exchange, the expectation is to only receive one message. This can be seen in bunny here:

@bindings.push(binding) unless @bindings.include?(binding)

It only creates a new binding if the binding doesn't already exist. The Bunny Mock gem however doesn't perform this check, so when the queue is bound multiple times, if we perform publish, the message count is wrong.