Sha256: 4df4fc6217dfe078b608955ba8b423c0c3333d67bdf8f9dfe9eb562c4af62fd0

Contents?: true

Size: 1.16 KB

Versions: 12

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'
require 'integration/coolio/spec_helper'

#
# We assume that default connection settings (amqp://guest:guest@localhost:5672/) should work
#
describe "AMQ::Client::CoolioClient", "Connection.Start", :nojruby => true do
  include EventedSpec::SpecHelper
  default_timeout 0.5

  context "with valid credentials" do
    it "should trigger the callback" do
      coolio do
        AMQ::Client::CoolioClient.connect do |client|
          client.should be_opened
          done
        end
      end
    end
  end

  context "with invalid credentials" do
    context "when given an errback" do
      it "should trigger the errback" do
        coolio do
          AMQ::Client::CoolioClient.connect(:port => 12938, :on_tcp_connection_failure => proc { done }) do |client|
            raise "This callback should never happen"
          end
        end
      end
    end

    context "when given no errback" do
      it "should raise an error" do
        expect {
          coolio do
            AMQ::Client::CoolioClient.connect(:port => 12938) { }
            done(0.5)
          end
        }.to raise_error(AMQ::Client::TCPConnectionFailed)
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
amq-client-0.7.0.alpha25 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha24 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha23 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha22 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha21 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha20 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha19 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha18 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha17 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha16 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha15 spec/integration/coolio/connection_start_spec.rb
amq-client-0.7.0.alpha14 spec/integration/coolio/connection_start_spec.rb