Module: EventedSpec::SpecHelper::AMQPHelpers::ExampleMethods

Included in:
EventedSpec::SpecHelper
Defined in:
lib/evented-spec/spec_helper/amqp_helpers.rb

Overview

module GroupMethods

Instance Method Summary collapse

Instance Method Details

#amqp(opts = {}) { ... } ⇒ Object

Yields to a given block inside EM.run and AMQP.start loops.

Parameters:

  • options (Hash)

    for amqp connection initialization

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :user (String) — default: 'guest'

    Username as defined by the AMQP server.

  • :pass (String) — default: 'guest'

    Password as defined by the AMQP server.

  • :vhost (String) — default: '/'

    Virtual host as defined by the AMQP server.

  • :timeout (Numeric) — default: nil

    Connection timeout, measured in seconds.

  • :logging (Boolean) — default: false

    Toggle the extremely verbose AMQP logging.

  • :spec_timeout (Numeric) — default: nil

    Amount of time before spec is stopped by timeout

Yields:

  • block to execute after amqp connects



37
38
39
40
41
# File 'lib/evented-spec/spec_helper/amqp_helpers.rb', line 37

def amqp(opts = {}, &block)
  opts = default_options.merge opts
  @evented_example = AMQPExample.new(opts, self, &block)
  @evented_example.run
end