Sha256: 8cc7aacb0d331d066e5417566a442a92b271eab96f78e480061ec0375eab3aac

Contents?: true

Size: 1001 Bytes

Versions: 57

Compression:

Stored size: 1001 Bytes

Contents

require "spec_helper"

describe Bunny::Queue, "backwards compatibility API" do
  let(:connection) do
    c = Bunny.new
    c.start
    c
  end

  after :all do
    connection.close if connection.open?
  end

  context "when queue name is specified" do
    let(:name) { "a queue declared at #{Time.now.to_i}" }

    it "declares a new queue with that name" do
      q    = Bunny::Queue.new(connection, name)
      q.name.should == name
    end
  end


  context "when queue name is passed on as an empty string" do
    it "uses server-assigned queue name" do
      q = Bunny::Queue.new(connection, "")
      q.name.should_not be_empty
      q.name.should =~ /^amq.gen.+/
      q.should be_server_named
      q.delete
    end
  end


  context "when queue name is completely omitted" do
    it "uses server-assigned queue name" do
      q = Bunny::Queue.new(connection)
      q.name.should_not be_empty
      q.name.should =~ /^amq.gen.+/
      q.should be_server_named
      q.delete
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
bunny-1.0.5 spec/compatibility/queue_declare_spec.rb
bunny-1.1.0.pre2 spec/compatibility/queue_declare_spec.rb
bunny-1.1.0.pre1 spec/compatibility/queue_declare_spec.rb
bunny-1.0.4 spec/compatibility/queue_declare_spec.rb
bunny-1.0.3 spec/compatibility/queue_declare_spec.rb
bunny-1.0.2 spec/compatibility/queue_declare_spec.rb
bunny-1.0.1 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.rc3 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.rc2 spec/compatibility/queue_declare_spec.rb
bunny-0.10.8 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.rc1 spec/compatibility/queue_declare_spec.rb
bunny-0.10.7 spec/compatibility/queue_declare_spec.rb
bunny-0.10.6 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.pre6 spec/compatibility/queue_declare_spec.rb
bunny-0.10.5 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.pre5 spec/compatibility/queue_declare_spec.rb
bunny-0.10.4 spec/compatibility/queue_declare_spec.rb
bunny-0.10.3 spec/compatibility/queue_declare_spec.rb
bunny-1.0.0.pre4 spec/compatibility/queue_declare_spec.rb