@@ -357,9 +357,21 @@ def get_ivar_from_args(opts)
357
357
let ( :promise2 ) { Promise . new ( executor : :immediate ) { 2 } }
358
358
let ( :promise3 ) { Promise . new ( executor : :immediate ) { [ 3 ] } }
359
359
360
- it 'does not execute the returned Promise' do
360
+ it 'executes the returned Promise by default ' do
361
361
composite = promise1 . zip ( promise2 , promise3 )
362
362
363
+ expect ( composite ) . to be_fulfilled
364
+ end
365
+
366
+ it 'executes the returned Promise when execute is true' do
367
+ composite = promise1 . zip ( promise2 , promise3 , execute : true )
368
+
369
+ expect ( composite ) . to be_fulfilled
370
+ end
371
+
372
+ it 'does not execute the returned Promise when execute is false' do
373
+ composite = promise1 . zip ( promise2 , promise3 , execute : false )
374
+
363
375
expect ( composite ) . to be_unscheduled
364
376
end
365
377
@@ -389,9 +401,21 @@ def get_ivar_from_args(opts)
389
401
let ( :promise2 ) { Promise . new ( executor : :immediate ) { 2 } }
390
402
let ( :promise3 ) { Promise . new ( executor : :immediate ) { [ 3 ] } }
391
403
392
- it 'does not execute the returned Promise' do
404
+ it 'executes the returned Promise by default ' do
393
405
composite = Promise . zip ( promise1 , promise2 , promise3 )
394
406
407
+ expect ( composite ) . to be_fulfilled
408
+ end
409
+
410
+ it 'executes the returned Promise when execute is true' do
411
+ composite = Promise . zip ( promise1 , promise2 , promise3 , execute : true )
412
+
413
+ expect ( composite ) . to be_fulfilled
414
+ end
415
+
416
+ it 'does not execute the returned Promise when execute is false' do
417
+ composite = Promise . zip ( promise1 , promise2 , promise3 , execute : false )
418
+
395
419
expect ( composite ) . to be_unscheduled
396
420
end
397
421
0 commit comments