Sha256: 733e7d21de12eb362f1fa3ca6e31cafe3605241a36ca77110f192cf4e82570ed

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

# encoding: utf-8

# connection_spec.rb

require File.expand_path(File.join(File.dirname(__FILE__), %w[.. .. lib bunny]))

describe Bunny do

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

  it "should be able to open a TCPSocket with a timeout" do
    b = Bunny.new(:spec => "0.8")
    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

2 entries across 2 versions & 1 rubygems

Version Path
bunny-0.7.12 spec/spec_08/connection_spec.rb
bunny-0.7.11 spec/spec_08/connection_spec.rb