Sha256: 684c7c05d3d7598d974dc49d8759b7f8b1b688ed6dc7eb535055e1e55af54b8c
Contents?: true
Size: 1.7 KB
Versions: 2
Compression:
Stored size: 1.7 KB
Contents
require 'al-test-utils' class TestConnection < Test::Unit::TestCase include AlTestUtils::Config include AlTestUtils::MockLogger def setup super end def teardown ActiveLdap::Base.clear_active_connections! super end priority :must priority :normal def test_bind_format_check connector = Class.new(ActiveLdap::Base) assert(!connector.connected?) exception = nil assert_raises(ArgumentError) do begin connector.establish_connection(:bind_format => "uid=%s,dc=test", :allow_anonymous => false) rescue Exception exception = $! raise end end assert_equal("Unknown key(s): bind_format", exception.message) end def test_can_reconnect? assert(!ActiveLdap::Base.connected?) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(!connection.send(:can_reconnect?, :reconnect_attempts => 10)) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(!connection.send(:can_reconnect?, :reconnect_attempts => 9)) config = current_configuration.merge("retry_limit" => 10) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(connection.send(:can_reconnect?, :reconnect_attempts => 8)) config = current_configuration.merge("retry_limit" => -1) ActiveLdap::Base.establish_connection(config) connection = ActiveLdap::Base.connection assert(connection.send(:can_reconnect?, :reconnect_attempts => -10)) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby-activeldap-0.8.3 | test/test_connection.rb |
ruby-activeldap-0.8.3.1 | test/test_connection.rb |