@@ -124,7 +124,7 @@ def test_modify_ops_add
124
124
end
125
125
126
126
def test_modify_ops_replace
127
- args = { :operations => [ [ :replace , "mail" , "testuser@example.com" ] ] }
127
+ args = { :operations => [ [ :replace , "mail" , "testuser@example.com" ] ] }
128
128
result = Net ::LDAP ::Connection . modify_ops ( args [ :operations ] )
129
129
expected = [ "0#\n \x01 \x02 0\x1E \x04 \x04 mail1\x16 \x04 \x14 testuser@example.com" ]
130
130
assert_equal ( expected , result )
@@ -191,9 +191,9 @@ def test_queued_read_reads_until_message_id_match
191
191
result2 = make_message ( 2 )
192
192
193
193
mock = flexmock ( "socket" )
194
- mock . should_receive ( :read_ber ) .
195
- and_return ( result1 ) .
196
- and_return ( result2 )
194
+ mock . should_receive ( :read_ber )
195
+ . and_return ( result1 )
196
+ . and_return ( result2 )
197
197
conn = Net ::LDAP ::Connection . new ( :socket => mock )
198
198
199
199
assert result = conn . queued_read ( 2 )
@@ -206,9 +206,9 @@ def test_queued_read_modify
206
206
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::ModifyResponse )
207
207
208
208
mock = flexmock ( "socket" )
209
- mock . should_receive ( :read_ber ) .
210
- and_return ( result1 ) .
211
- and_return ( result2 )
209
+ mock . should_receive ( :read_ber )
210
+ . and_return ( result1 )
211
+ . and_return ( result2 )
212
212
mock . should_receive ( :write )
213
213
conn = Net ::LDAP ::Connection . new ( :socket => mock )
214
214
@@ -227,9 +227,9 @@ def test_queued_read_add
227
227
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::AddResponse )
228
228
229
229
mock = flexmock ( "socket" )
230
- mock . should_receive ( :read_ber ) .
231
- and_return ( result1 ) .
232
- and_return ( result2 )
230
+ mock . should_receive ( :read_ber )
231
+ . and_return ( result1 )
232
+ . and_return ( result2 )
233
233
mock . should_receive ( :write )
234
234
conn = Net ::LDAP ::Connection . new ( :socket => mock )
235
235
@@ -245,9 +245,9 @@ def test_queued_read_rename
245
245
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::ModifyRDNResponse )
246
246
247
247
mock = flexmock ( "socket" )
248
- mock . should_receive ( :read_ber ) .
249
- and_return ( result1 ) .
250
- and_return ( result2 )
248
+ mock . should_receive ( :read_ber )
249
+ . and_return ( result1 )
250
+ . and_return ( result2 )
251
251
mock . should_receive ( :write )
252
252
conn = Net ::LDAP ::Connection . new ( :socket => mock )
253
253
@@ -266,9 +266,9 @@ def test_queued_read_delete
266
266
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::DeleteResponse )
267
267
268
268
mock = flexmock ( "socket" )
269
- mock . should_receive ( :read_ber ) .
270
- and_return ( result1 ) .
271
- and_return ( result2 )
269
+ mock . should_receive ( :read_ber )
270
+ . and_return ( result1 )
271
+ . and_return ( result2 )
272
272
mock . should_receive ( :write )
273
273
conn = Net ::LDAP ::Connection . new ( :socket => mock )
274
274
@@ -284,13 +284,13 @@ def test_queued_read_setup_encryption_with_start_tls
284
284
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::ExtendedResponse )
285
285
286
286
mock = flexmock ( "socket" )
287
- mock . should_receive ( :read_ber ) .
288
- and_return ( result1 ) .
289
- and_return ( result2 )
287
+ mock . should_receive ( :read_ber )
288
+ . and_return ( result1 )
289
+ . and_return ( result2 )
290
290
mock . should_receive ( :write )
291
291
conn = Net ::LDAP ::Connection . new ( :socket => mock )
292
- flexmock ( Net ::LDAP ::Connection ) . should_receive ( :wrap_with_ssl ) . with ( mock , { } , nil ) .
293
- and_return ( mock )
292
+ flexmock ( Net ::LDAP ::Connection ) . should_receive ( :wrap_with_ssl ) . with ( mock , { } , nil )
293
+ . and_return ( mock )
294
294
295
295
conn . next_msgid # simulates ongoing query
296
296
@@ -303,9 +303,9 @@ def test_queued_read_bind_simple
303
303
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::BindResult )
304
304
305
305
mock = flexmock ( "socket" )
306
- mock . should_receive ( :read_ber ) .
307
- and_return ( result1 ) .
308
- and_return ( result2 )
306
+ mock . should_receive ( :read_ber )
307
+ . and_return ( result1 )
308
+ . and_return ( result2 )
309
309
mock . should_receive ( :write )
310
310
conn = Net ::LDAP ::Connection . new ( :socket => mock )
311
311
@@ -314,7 +314,8 @@ def test_queued_read_bind_simple
314
314
assert result = conn . bind (
315
315
method : :simple ,
316
316
username : "uid=user1,ou=People,dc=rubyldap,dc=com" ,
317
- password : "passworD1" )
317
+ password : "passworD1" ,
318
+ )
318
319
assert result . success?
319
320
assert_equal 2 , result . message_id
320
321
end
@@ -324,9 +325,9 @@ def test_queued_read_bind_sasl
324
325
result2 = make_message ( 2 , app_tag : Net ::LDAP ::PDU ::BindResult )
325
326
326
327
mock = flexmock ( "socket" )
327
- mock . should_receive ( :read_ber ) .
328
- and_return ( result1 ) .
329
- and_return ( result2 )
328
+ mock . should_receive ( :read_ber )
329
+ . and_return ( result1 )
330
+ . and_return ( result2 )
330
331
mock . should_receive ( :write )
331
332
conn = Net ::LDAP ::Connection . new ( :socket => mock )
332
333
@@ -336,7 +337,8 @@ def test_queued_read_bind_sasl
336
337
method : :sasl ,
337
338
mechanism : "fake" ,
338
339
initial_credential : "passworD1" ,
339
- challenge_response : flexmock ( "challenge proc" ) )
340
+ challenge_response : flexmock ( "challenge proc" ) ,
341
+ )
340
342
assert result . success?
341
343
assert_equal 2 , result . message_id
342
344
end
@@ -481,8 +483,8 @@ def test_search_net_ldap_connection_event
481
483
search_result_ber = Net ::BER ::BerIdentifiedArray . new ( [ Net ::LDAP ::ResultCodeSuccess , "" , "" ] )
482
484
search_result_ber . ber_identifier = Net ::LDAP ::PDU ::SearchResult
483
485
search_result = [ 1 , search_result_ber ]
484
- @tcp_socket . should_receive ( :read_ber ) . and_return ( search_data ) .
485
- and_return ( search_result )
486
+ @tcp_socket . should_receive ( :read_ber ) . and_return ( search_data )
487
+ . and_return ( search_result )
486
488
487
489
events = @service . subscribe "search.net_ldap_connection"
488
490
unread = @service . subscribe "search_messages_unread.net_ldap_connection"
0 commit comments