@@ -235,13 +235,11 @@ module Concurrent
235
235
let ( :queue ) { subject . instance_variable_get ( :@queue ) }
236
236
237
237
it 'raises an exception when given an invalid time' do
238
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
239
238
task = subject . post ( 10 ) { nil }
240
239
expect { task . reschedule ( -1 ) } . to raise_error ( ArgumentError )
241
240
end
242
241
243
242
it 'does not change the current schedule when given an invalid time' do
244
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
245
243
task = subject . post ( 10 ) { nil }
246
244
expected = task . schedule_time
247
245
begin
@@ -254,7 +252,6 @@ module Concurrent
254
252
it 'reschdules a pending and unpost task when given a valid time' do
255
253
initial_delay = 10
256
254
rescheduled_delay = 20
257
- expect ( queue ) . to receive ( :push ) . twice . with ( any_args ) . and_call_original
258
255
task = subject . post ( initial_delay ) { nil }
259
256
original_schedule = task . schedule_time
260
257
success = task . reschedule ( rescheduled_delay )
@@ -264,7 +261,6 @@ module Concurrent
264
261
end
265
262
266
263
it 'returns false once the task has been post to the executor' do
267
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
268
264
start_latch = Concurrent ::CountDownLatch . new
269
265
continue_latch = Concurrent ::CountDownLatch . new
270
266
@@ -282,7 +278,6 @@ module Concurrent
282
278
end
283
279
284
280
it 'returns false once the task is processing' do
285
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
286
281
start_latch = Concurrent ::CountDownLatch . new
287
282
continue_latch = Concurrent ::CountDownLatch . new
288
283
task = subject . post ( 0.1 ) do
@@ -299,7 +294,6 @@ module Concurrent
299
294
end
300
295
301
296
it 'returns false once the task has is complete' do
302
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
303
297
task = subject . post ( 0.1 ) { nil }
304
298
task . value ( 2 )
305
299
expected = task . schedule_time
@@ -309,7 +303,6 @@ module Concurrent
309
303
end
310
304
311
305
it 'returns false when not running' do
312
- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
313
306
task = subject . post ( 10 ) { nil }
314
307
subject . shutdown
315
308
subject . wait_for_termination ( 2 )
0 commit comments