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 Apr 5, 2024
1 parent 1d38606 commit d5e82fa
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 @@ -540,4 +540,15 @@ def test_search_with_controls
# ensure no unread
assert unread.empty?, "should not have any leftover unread messages"
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 d5e82fa

Please sign in to comment.