Sha256: 694f33f223af568b0bcd8a684aef33d905aaad95f8a05ea42641e4b3db5500ef

Contents?: true

Size: 682 Bytes

Versions: 1

Compression:

Stored size: 682 Bytes

Contents

FancySpec describe: Future with: {
  it: "should compose Futures to create execution pipelines" for: '&& when: {
    def some_computation: num {
      num upto: (num ** num ** num)
    }

    f = self @ some_computation: 2 && @{select: 'even?} && 'size
    f is_a?: Future . should == true
    f value is_a?: Fixnum . should == true
  }
}

FancySpec describe: FutureCollection with: {
  it: "should execute a block for each future in the collection when it's ready" for: 'each: when: {
    futures = 0 upto: 10 . map: |i| {
      i ** i @ ** i
    }

    fc = FutureCollection new: futures
    fc each: |val| {
      val is_a?: Integer . should == true
    }

    fc await_all
  }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fancy-0.3.3 tests/future.fy