Sha256: 8117bebb5fd32c5c62e4bdb439a5dc62db0adad6bbd2949e6578d791b0dd6be2
Contents?: true
Size: 467 Bytes
Versions: 77
Compression:
Stored size: 467 Bytes
Contents
require 'promise' describe 'Promise.when' do it 'calls the block with all promises results' do a = Promise.new b = Promise.new x = 42 Promise.when(a, b).then {|y, z| x = y + z } a.resolve(1) b.resolve(2) x.should == 3 end it 'can be built lazily' do a = Promise.new b = Promise.value(3) x = 42 Promise.when(a).and(b).then {|c, d| x = c + d } a.resolve(2) x.should == 5 end end
Version data entries
77 entries across 77 versions & 3 rubygems