Sha256: 9af3bcad55200e3eb5f146f446ffc4b1267a8d5a81d5b229b2e1a4854f2ef692

Contents?: true

Size: 937 Bytes

Versions: 13

Compression:

Stored size: 937 Bytes

Contents

require "spec_helper"

describe Bunny::Queue, "backwards compatibility API" do
  let(:connection) do
    c = Bunny.new
    c.start
    c
  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

13 entries across 13 versions & 1 rubygems

Version Path
bunny-0.9.0.pre13 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre12 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre11 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre10 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre9 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre8 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre7 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre6 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre5 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre4 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre3 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre2 spec/compatibility/queue_declare_spec.rb
bunny-0.9.0.pre1 spec/compatibility/queue_declare_spec.rb