Sha256: 380ce7ea957559ae84193d3b0f628fb3c0addd992d3c5af77ce4546f0ae20c7b

Contents?: true

Size: 1.56 KB

Versions: 11

Compression:

Stored size: 1.56 KB

Contents

require_relative '../test_helper'

# NOTE: These tests depend on the OpenLDAP retcode overlay.
# See: section 12.12 http://www.openldap.org/doc/admin24/overlays.html

class TestReturnCodeIntegration < LDAPIntegrationTestCase
  def test_operations_error
    refute @ldap.search(filter: "cn=operationsError", base: "ou=Retcodes,dc=rubyldap,dc=com")
    assert result = @ldap.get_operation_result

    assert_equal Net::LDAP::ResultCodeOperationsError, result.code
    assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeOperationsError], result.message
  end

  def test_protocol_error
    refute @ldap.search(filter: "cn=protocolError", base: "ou=Retcodes,dc=rubyldap,dc=com")
    assert result = @ldap.get_operation_result

    assert_equal Net::LDAP::ResultCodeProtocolError, result.code
    assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeProtocolError], result.message
  end

  def test_time_limit_exceeded
    assert @ldap.search(filter: "cn=timeLimitExceeded", base: "ou=Retcodes,dc=rubyldap,dc=com")
    assert result = @ldap.get_operation_result

    assert_equal Net::LDAP::ResultCodeTimeLimitExceeded, result.code
    assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeTimeLimitExceeded], result.message
  end

  def test_size_limit_exceeded
    assert @ldap.search(filter: "cn=sizeLimitExceeded", base: "ou=Retcodes,dc=rubyldap,dc=com")
    assert result = @ldap.get_operation_result

    assert_equal Net::LDAP::ResultCodeSizeLimitExceeded, result.code
    assert_equal Net::LDAP::ResultStrings[Net::LDAP::ResultCodeSizeLimitExceeded], result.message
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
net-ldap-0.16.1 test/integration/test_return_codes.rb
net-ldap-0.16.0 test/integration/test_return_codes.rb
net-ldap-0.15.0 test/integration/test_return_codes.rb
net-ldap-0.14.0 test/integration/test_return_codes.rb
net-ldap-0.13.0 test/integration/test_return_codes.rb
net-ldap-0.12.1 test/integration/test_return_codes.rb
net-ldap-0.12.0 test/integration/test_return_codes.rb
net-ldap-0.11 test/integration/test_return_codes.rb
net-ldap-0.10.1 test/integration/test_return_codes.rb
net-ldap-0.10.0 test/integration/test_return_codes.rb
net-ldap-0.9.0 test/integration/test_return_codes.rb