require_relative '../../../test_helper'
require 'socket'

class TimeoutInListenQueueTest < Test::Unit::TestCase

  include LaunchableRoleTests
  include ServerTestHelpers

  def setup
    @object = Bane::Behaviors::Servers::TimeoutInListenQueue.make(IRRELEVANT_PORT, Bane::Behaviors::Servers::LOCALHOST)
  end

  def test_never_connects
    run_server(Bane::Behaviors::Servers::TimeoutInListenQueue.make(port, Bane::Behaviors::Servers::LOCALHOST)) do
      assert_raise(Errno::ECONNREFUSED) { TCPSocket.new('localhost', port) }
    end
  end

  def port
    4001
  end

end

require_relative '../../../test_helper'
require 'socket'

class TimeoutInListenQueueTest < Test::Unit::TestCase

  include LaunchableRoleTests
  include ServerTestHelpers

  def setup
    @object = Bane::Behaviors::Servers::TimeoutInListenQueue.make(IRRELEVANT_PORT, Bane::Behaviors::Servers::LOCALHOST)
  end

  def test_never_connects
    run_server(Bane::Behaviors::Servers::TimeoutInListenQueue.make(port, Bane::Behaviors::Servers::LOCALHOST)) do
      assert_raise(Errno::ETIMEDOUT) { TCPSocket.new('localhost', port) }
    end
  end

  def port
    4001
  end

end

Fix test which threw ETIMEDOUT on ruby 1.9.3p551 on Mac OS X.
Fix test which threw ETIMEDOUT on ruby 1.9.3p551 on Mac OS X.
