File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ def initialize(ber_object)
123123 when ExtendedResponse
124124 parse_extended_response ( ber_object [ 1 ] )
125125 else
126- raise LdapPduError . new ( "unknown pdu-type: #{ @app_tag } " )
126+ raise Net :: LDAP :: PDU :: Error , "unknown pdu-type: #{ @app_tag } "
127127 end
128128
129129 parse_controls ( ber_object [ 2 ] ) if ber_object [ 2 ]
Original file line number Diff line number Diff line change @@ -340,6 +340,19 @@ 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+ app_tag : Net ::LDAP ::PDU ::SearchResult ,
347+ code : Net ::LDAP ::ResultCodeSuccess ,
348+ matched_dn : "" ,
349+ error_message : "" ,
350+ }
351+ ber = Net ::BER ::BerIdentifiedArray . new ( [ options [ :code ] , options [ :matched_dn ] , options [ :error_message ] ] )
352+ assert_raise Net ::LDAP ::PDU ::Error do
353+ Net ::LDAP ::PDU . new ( [ 0 , ber ] )
354+ end
355+ end
343356end
344357
345358class TestLDAPConnectionErrors < Test ::Unit ::TestCase
You can’t perform that action at this time.
0 commit comments