test/integration/test_bind.rb in net-ldap-0.12.1 vs test/integration/test_bind.rb in net-ldap-0.13.0

- old
+ new

@@ -3,9 +3,17 @@ class TestBindIntegration < LDAPIntegrationTestCase def test_bind_success assert @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1"), @ldap.get_operation_result.inspect end + def test_bind_timeout + @ldap.port = 8389 + error = assert_raise Net::LDAP::Error do + @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: "passworD1") + end + assert_equal('Connection timed out - user specified timeout', error.message) + end + def test_bind_anonymous_fail refute @ldap.bind(method: :simple, username: "uid=user1,ou=People,dc=rubyldap,dc=com", password: ""), @ldap.get_operation_result.inspect result = @ldap.get_operation_result assert_equal Net::LDAP::ResultCodeUnwillingToPerform, result.code