Logo: Relish

  1. Sign up
  2. Sign in

Project: Message-driver 0.7

Destination Metadata

  • @bunny
  • @in_memory
Background
Given
I am connected to the broker
And
I have a destination :my_queue with no messages on it
Scenarios
Checking the message count when the queue is empty
When
I execute the following code
destination = MessageDriver::Client.find_destination(:my_queue)
expect(destination.message_count).to eq(0)
Then
I expect to have no errors
And
I expect to find no messages on :my_queue
Checking the message count when the queue has messages
When
I send the following messages to :my_queue
body
Test Message 1
Test Message 2
And
I allow for processing
And
I execute the following code
destination = MessageDriver::Client.find_destination(:my_queue)
expect(destination.message_count).to eq(2)
Then
I expect to have no errors
And
I expect to find 2 messages on :my_queue
Check the consumer count when the queue has no consumers
When
I execute the following code
destination = MessageDriver::Client.find_destination(:my_queue)
expect(destination.consumer_count).to eq(0)
Then
I expect to have no errors
Check the consumer count when the queue has consumers
Given
I create some subscriptions
3.times do
  MessageDriver::Client.subscribe_with(:my_queue) do |message|
    puts message.inspect
  end
end
When
I execute the following code
destination = MessageDriver::Client.find_destination(:my_queue)
expect(destination.consumer_count).to eq(3)
Then
I expect to have no errors

Last published 10 months ago by soupmatt.