 
         let future = futures.all()
 
-        waitUntil { done in
-          future.fail { _ in
-            done()
-          }
-        }
-        
+        futures_wait {
+          [future.wrap()]
+        }
+
         it ("rejects the promise") {
           expect(future.state) == FutureState.Rejected
         }

      }
    }
    
    describe("any") {
      func f1(x: Int) -> Future<Int> {
        return Future {
          NSThread.sleepForTimeInterval(Double(x))
          return x
        }
      }
      
      func f2(x: Int) -> Future<Int> {
        return Promise { promise in
          NSThread.sleepForTimeInterval(Double(x))
          promise.resolve(x)
        }
      }

      func f3(x: Int) -> Future<Int> {
        return Future {
          NSThread.sleepForTimeInterval(Double(x))
          throw NSError(domain: "", code: 1, userInfo: nil)
        }
      }
      
      func f4(x: Int) -> Future<Int> {
        return Promise { promise in
          NSThread.sleepForTimeInterval(Double(x))
          promise.reject()
        }
      }

      it("works") {
        waitUntil(timeout: 5) { done in
          [f1(1), f2(2), f3(1)].any().then { value in
            expect(value) == 1
          }.fail { _ in
            fail()
          }.finally(done)
        }
      }

      it("works2") {2
        waitUntil(timeout: 5) { done in
          [f2(1), f3(2)].any().then { value in
            expect(value) == 1
          }.fail { _ in
            fail()
          }.finally(done)
        }
      }

      it("works3") {
        waitUntil(timeout: 5) { done in
          [f3(1), f4(2)].any().then { value in
            fail()
          }.fail { error in
            expect(error).to(beNil())
          }.finally(done)
        }
      }
    }
  }
}

      }

      it("properly calls finally when future is rejected") {
        futures_wait {
          let futures = [
            future.then {
              thenCalled = true
            }.fail { _ in
              failedCalled = true
            }.finally {
              finallyCalled = true
            }
          ]

          future.reject(nil)

          return futures
        }

        expect(thenCalled) == false
        expect(failedCalled) == true
