Skip to content

Commit

Permalink
Add test for connection.ldapwhoami
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Feb 23, 2024
1 parent 6e4cacc commit 68301c6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_ldap_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -515,4 +515,15 @@ def test_password_modify
)
assert result
end

def test_ldapwhoami
ber = Net::BER::BerIdentifiedArray.new([Net::LDAP::ResultCodeSuccess, '', '', 0, 'dn:uid=zerosteiner,ou=users,dc=example,dc=org'])
ber.ber_identifier = Net::LDAP::PDU::ExtendedResponse
response = [1, ber]

@tcp_socket.should_receive(:read_ber).and_return(response)

result = @connection.ldapwhoami
assert result.extended_response == 'dn:uid=zerosteiner,ou=users,dc=example,dc=org'
end
end

0 comments on commit 68301c6

Please sign in to comment.