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)
123
123
when ExtendedResponse
124
124
parse_extended_response ( ber_object [ 1 ] )
125
125
else
126
- raise LdapPduError . new ( "unknown pdu-type: #{ @app_tag } " )
126
+ raise Net :: LDAP :: PDU :: Error , "unknown pdu-type: #{ @app_tag } "
127
127
end
128
128
129
129
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
340
340
assert result . success?
341
341
assert_equal 2 , result . message_id
342
342
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
343
356
end
344
357
345
358
class TestLDAPConnectionErrors < Test ::Unit ::TestCase
You can’t perform that action at this time.
0 commit comments