Sha256: be4b947a666ed6772694ecadb63b8fc71af721fdc56531a1c6f6b44322589ce3

Contents?: true

Size: 1.23 KB

Versions: 17

Compression:

Stored size: 1.23 KB

Contents

require "spec_helper"


describe "Any queue" do

  #
  # Environment
  #

  let(:connection) { HotBunnies.connect }
  let(:channel)    { connection.create_channel }

  after :each do
    channel.close
    connection.close
  end


  #
  # Examples
  #

  it "can be bound to amq.fanout" do
    exchange = channel.exchange("amq.fanout", :type => :fanout, :durable => true, :auto_delete => false)
    queue    = channel.queue("", :auto_delete => true)
    exchange.publish("")
    queue.get.should be_nil

    queue.bind(exchange)

    exchange.publish("", :routing_key => queue.name)
    queue.get.should_not be_nil
  end


  it "can be bound to a newly declared exchange" do
    exchange = channel.exchange("hot.bunnies.fanout", :type => :fanout, :durable => false, :auto_delete => true)
    queue    = channel.queue("", :auto_delete => true)
    exchange.publish("")
    queue.get.should be_nil

    queue.bind(exchange)

    exchange.publish("", :routing_key => queue.name)
    queue.get.should_not be_nil
  end


  it "is automatically bound to the default exchange" do
    exchange = channel.default_exchange
    queue    = channel.queue("", :auto_delete => true)

    exchange.publish("", :routing_key => queue.name)
    queue.get.should_not be_nil
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
hot_bunnies-1.5.0-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.4.0-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.4.0.pre4-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.4.0.pre3-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.4.0.pre2-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.4.0.pre1-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.8-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.7-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.6-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.5-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.4-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.3-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.2-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.3.1-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.2.2-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.2.1-java spec/integration/queue_bind_spec.rb
hot_bunnies-1.2.0-java spec/integration/queue_bind_spec.rb