Sha256: 490f823f3752e9a2bca94a541038f9d173f8941d37c834dbee1ae34ecf1c1b8c

Contents?: true

Size: 969 Bytes

Versions: 3

Compression:

Stored size: 969 Bytes

Contents

require File.expand_path('../test_helper', __FILE__)

describe "Backburner::Connection class" do
  describe "for initialize" do
    before do
      @connection = Backburner::Connection.new("beanstalk://localhost")
    end

    it "should store url in accessor" do
      assert_equal "beanstalk://localhost", @connection.url
    end

    it "should setup beanstalk connection" do
      assert_kind_of Beanstalk::Pool, @connection.beanstalk
    end
  end # initialize

  describe "for bad uri" do
    it "should raise a BadUrl" do
      assert_raises(Backburner::Connection::BadURL) {
        @connection = Backburner::Connection.new("fake://foo")
      }
    end
  end

  describe "for delegated methods" do
    before do
      @connection = Backburner::Connection.new("beanstalk://localhost")
    end

    it "delegate methods to beanstalk connection" do
      assert_equal "localhost:11300", @connection.list_tubes.keys.first
    end
  end # delegator
end # Connection

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
backburner-0.0.3 test/connection_test.rb
backburner-0.0.2 test/connection_test.rb
backburner-0.0.1 test/connection_test.rb