Sha256: 9340643338f2576bbfde4e6ccd3f103a52250f55b19f42df893e8ba3bf24ec3a

Contents?: true

Size: 892 Bytes

Versions: 4

Compression:

Stored size: 892 Bytes

Contents

require_relative '../test_helper'

class TestBERIntegration < LDAPIntegrationTestCase
  # Test whether the TRUE boolean value is encoded correctly by performing a
  # search operation.
  def test_true_ber_encoding
    # request these attrs to simplify test; use symbols to match Entry#attribute_names
    attrs = [:dn, :uid, :cn, :mail]

    assert types_entry = @ldap.search(
      base: "dc=rubyldap,dc=com",
      filter: "(uid=user1)",
      size: 1,
      attributes: attrs,
      attributes_only: true,
    ).first

    # matches attributes we requested
    assert_equal attrs, types_entry.attribute_names

    # assert values are empty
    types_entry.each do |name, values|
      next if name == :dn
      assert values.empty?
    end

    assert_includes Net::LDAP::ResultCodesSearchSuccess,
      @ldap.get_operation_result.code, "should be a successful search operation"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
net-ldap-0.16.1 test/integration/test_ber.rb
net-ldap-0.16.0 test/integration/test_ber.rb
net-ldap-0.15.0 test/integration/test_ber.rb
net-ldap-0.14.0 test/integration/test_ber.rb