Skip to content

Commit a7f3b25

Browse files
Merge pull request #317 from unagi/bugfix-uninitialized_constant_pduerror
Fix 'uninitialized constant Net::LDAP::PDU::LdapPduError' error
2 parents 875611d + 422a0e3 commit a7f3b25

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test_ldap_connection.rb

+12
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,18 @@ def test_queued_read_bind_sasl
340340
assert result.success?
341341
assert_equal 2, result.message_id
342342
end
343+
344+
def test_invalid_pdu_type
345+
options = {
346+
code: Net::LDAP::ResultCodeSuccess,
347+
matched_dn: "",
348+
error_message: "",
349+
}
350+
ber = Net::BER::BerIdentifiedArray.new([options[:code], options[:matched_dn], options[:error_message]])
351+
assert_raise Net::LDAP::PDU::Error do
352+
Net::LDAP::PDU.new([0, ber])
353+
end
354+
end
343355
end
344356

345357
class TestLDAPConnectionErrors < Test::Unit::TestCase

0 commit comments

Comments
 (0)