You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume that this was to make popping messages off of queues in specs a lot cleaner. However, it makes BunnyMock only really able to help test the publishing of messages. Any code that attempts to use Bunny to read messages from queues would not be able to use BunnyMock.new as a replacement for Bunny.new.
Ideally the APIs would match, however changing it would break anyone using the current behavior. I propose creating some sort of config option (e.g. BunnyMock.use_bunny_queue_pop_api = true) that could default to the current behavior. The README could clearly show how to use the two options.
Thoughts? Let me know if I'm misunderstanding something.
I'll put together a PR if you're open to the idea.
The text was updated successfully, but these errors were encountered:
Yeah, this is leftover from when this was a personal use thing before I made it into a gem - because I didn't like the 3 element array style...probably not a good idea in hind sight lol. The apis should definitely match - so it can be used as a drop in replacement.
I think your idea is a good one, but we should add a deprecation notice to it - ie. if they keep using the current behavior they will know it will be phased out in a later version and be only available as the Bunny api behavior.
I took your idea and implemented it - along with adding a ton more stuff to match Bunny such as GetResponse and MessageProperties implementations and passing options and blocks to Queue#pop
I see that BunnyMock::Queue#pop returns a hash with
:message
and:options
keys:However Bunny::Queue#pop returns a 3 element array:
I assume that this was to make popping messages off of queues in specs a lot cleaner. However, it makes BunnyMock only really able to help test the publishing of messages. Any code that attempts to use Bunny to read messages from queues would not be able to use
BunnyMock.new
as a replacement forBunny.new
.Ideally the APIs would match, however changing it would break anyone using the current behavior. I propose creating some sort of config option (e.g.
BunnyMock.use_bunny_queue_pop_api = true
) that could default to the current behavior. The README could clearly show how to use the two options.Thoughts? Let me know if I'm misunderstanding something.
I'll put together a PR if you're open to the idea.
The text was updated successfully, but these errors were encountered: