Sha256: f74f1fe8234b62e0f68565a580a2076dbdfe25fc26a10a53dd5a49b56d4f71ad

Contents?: true

Size: 745 Bytes

Versions: 7

Compression:

Stored size: 745 Bytes

Contents

# encoding: utf-8

# connection_spec.rb

require "bunny"

describe Bunny do

  it "should raise an error if the wrong user name or password is used" do
    b = Bunny.new(:spec => '0.9', :user => 'wrong')
    lambda { b.start}.should raise_error(Bunny::ProtocolError)
  end

  it "should merge custom settings from AMQP URL with default settings" do
    b = Bunny.new("amqp://tagadab", :spec => "0.9")
    b.host.should eql("tagadab")
  end

  it "should be able to open a TCPSocket with a timeout" do
    b = Bunny.new(:spec => "0.9")
    connect_timeout = 5
    lambda {
      Bunny::Timer::timeout(connect_timeout, Qrack::ConnectionTimeout) do
        TCPSocket.new(b.host, b.port)
      end
    }.should_not raise_error(Exception)
  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
bunny-0.7.12 spec/spec_09/connection_spec.rb
bunny-0.7.11 spec/spec_09/connection_spec.rb
bunny-0.7.10 spec/spec_09/connection_spec.rb
sparqcode_bunny-0.0.2 spec/spec_09/connection_spec.rb
bunny-0.7.9 spec/spec_09/connection_spec.rb
sparqcode_bunny-0.0.1 spec/spec_09/connection_spec.rb
bunny-0.7.8 spec/spec_09/connection_spec.rb