@@ -235,13 +235,11 @@ module Concurrent
235235 let ( :queue ) { subject . instance_variable_get ( :@queue ) }
236236
237237 it 'raises an exception when given an invalid time' do
238- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
239238 task = subject . post ( 10 ) { nil }
240239 expect { task . reschedule ( -1 ) } . to raise_error ( ArgumentError )
241240 end
242241
243242 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
245243 task = subject . post ( 10 ) { nil }
246244 expected = task . schedule_time
247245 begin
@@ -254,7 +252,6 @@ module Concurrent
254252 it 'reschdules a pending and unpost task when given a valid time' do
255253 initial_delay = 10
256254 rescheduled_delay = 20
257- expect ( queue ) . to receive ( :push ) . twice . with ( any_args ) . and_call_original
258255 task = subject . post ( initial_delay ) { nil }
259256 original_schedule = task . schedule_time
260257 success = task . reschedule ( rescheduled_delay )
@@ -264,7 +261,6 @@ module Concurrent
264261 end
265262
266263 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
268264 start_latch = Concurrent ::CountDownLatch . new
269265 continue_latch = Concurrent ::CountDownLatch . new
270266
@@ -282,7 +278,6 @@ module Concurrent
282278 end
283279
284280 it 'returns false once the task is processing' do
285- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
286281 start_latch = Concurrent ::CountDownLatch . new
287282 continue_latch = Concurrent ::CountDownLatch . new
288283 task = subject . post ( 0.1 ) do
@@ -299,7 +294,6 @@ module Concurrent
299294 end
300295
301296 it 'returns false once the task has is complete' do
302- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
303297 task = subject . post ( 0.1 ) { nil }
304298 task . value ( 2 )
305299 expected = task . schedule_time
@@ -309,7 +303,6 @@ module Concurrent
309303 end
310304
311305 it 'returns false when not running' do
312- expect ( queue ) . to receive ( :push ) . once . with ( any_args ) . and_call_original
313306 task = subject . post ( 10 ) { nil }
314307 subject . shutdown
315308 subject . wait_for_termination ( 2 )
0 commit comments