Module: BunnyMock

Defined in:
lib/bunny-mock.rb,
lib/bunny_mock/queue.rb,
lib/bunny_mock/channel.rb,
lib/bunny_mock/session.rb,
lib/bunny_mock/version.rb,
lib/bunny_mock/exchange.rb,
lib/bunny_mock/get_response.rb,
lib/bunny_mock/exchanges/topic.rb,
lib/bunny_mock/exchanges/direct.rb,
lib/bunny_mock/exchanges/fanout.rb,
lib/bunny_mock/exchanges/headers.rb,
lib/bunny_mock/message_properties.rb

Overview

A mock RabbitMQ client based on Bunny

Defined Under Namespace

Modules: Exchanges Classes: Channel, Exchange, GetResponse, MessageProperties, Queue, Session

Constant Summary collapse

PROTOCOL_VERSION =

AMQP protocol version

AMQ::Protocol::PROTOCOL_VERSION
VERSION =

Returns Version of the library.

Returns:

  • (String)

    Version of the library

'1.7.0'.freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.use_bunny_queue_pop_apiBoolean

Returns Use Bunny API for Queue#pop (default: false).

Returns:

  • (Boolean)

    Use Bunny API for Queue#pop (default: false)



48
49
50
# File 'lib/bunny-mock.rb', line 48

def use_bunny_queue_pop_api
  @use_bunny_queue_pop_api.nil? ? false : @use_bunny_queue_pop_api
end

Class Method Details

.newBunnyMock::Session

Instantiate a new mock Bunny session

Returns:



42
43
44
45
# File 'lib/bunny-mock.rb', line 42

def new(*)
  # return new mock session
  BunnyMock::Session.new
end

.protocol_versionString

Returns AMQP protocol version.

Returns:

  • (String)

    AMQP protocol version



58
59
60
# File 'lib/bunny-mock.rb', line 58

def protocol_version
  AMQ::Protocol::PROTOCOL_VERSION
end

.versionString

Returns Bunny mock version.

Returns:

  • (String)

    Bunny mock version



53
54
55
# File 'lib/bunny-mock.rb', line 53

def version
  VERSION
end