       }
 
       it("properly calls finally when future is rejected") {
-        future.then {
-          thenCalled = true
-        }.fail { _ in
-          failedCalled = true
-        }.finally {
-          finallyCalled = true
-        }
-        
-        future.reject(nil)
-        
-        waitUntil { done in done() }
+        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

        
        it("resolves as soon as one future is resolved") {
          expect(futures.map { $0.state }).to(contain(FutureState.Resolved))
        }
        
        it("resolves with the first value resolved") {

        var thenCalled = false
        
        let future = Future<Void>()

        futures_wait {
          let futures = [
            future.fail { _ in failCalledWhenRejected = true },
            future.then { thenCalled = true }
          ]

          future.reject()

          return futures
        }

        expect(future.state) == FutureState.Rejected
        expect(thenCalled) == false
        expect(failCalledWhenRejected) == true

        futures_wait {
          [
            future.fail { _ in failCalledDirectlyWhenAlreadyRejected = true }
          ]
        }

        expect(failCalledDirectlyWhenAlreadyRejected) == true
      }

      it("resolves/reject on specified queue") {
        for queue in [dispatch_get_main_queue(), dispatch_queue_create(NSUUID().UUIDString, DISPATCH_QUEUE_CONCURRENT)] {
          var resolveQueueLabel: UnsafePointer<Int8>!
          var rejectQueueLabel: UnsafePointer<Int8>!
          var finallyQueueLabel: UnsafePointer<Int8>!

          let futureResolved = Future<Void>()
          let futureRejected = Future<Void>()

          futures_wait {
            let futures = [
              futureResolved.then(queue) {
                resolveQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)
              },
              futureRejected.fail(queue) { _ in
                rejectQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)
              },
              futureRejected.finally(queue) {
                finallyQueueLabel = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)
              }
            ]

            futureResolved.resolve()
            futureRejected.reject(nil)

            return futures
          }

          expect(futureResolved.state) == FutureState.Resolved
          expect(futureRejected.state) == FutureState.Rejected
          expect(resolveQueueLabel) == dispatch_queue_get_label(queue)
          expect(rejectQueueLabel) == dispatch_queue_get_label(queue)
        }
      }

      it("calls block in FIFO order") {
        var order: [Int] = []
        
        let future = Future<Void>()

        futures_wait {
          let futures = (0...2).map { x in
            future.then {
              order.append(x)
            }
          }

          future.resolve()

          return futures
        }

        expect(order) == [0, 1, 2]
      }
      
      it("can chain futures") {
        var results: [Int] = []
        let future = Future<Int>()

        futures_wait {
          let futures = [
            future.then { result -> Int in
              results.append(result)
              return 2
            }.then { result in
              results.append(result)
            }.wrap()
          ]

          future.resolve(1)

          return futures
        }

        expect(results) == [1, 2]
      }
      
      context("when a future fails") {
        it("it rejects up to the parent") {
          var results: [Int] = []
          let future = Future<Int>()

          futures_wait {
            let futures = [
              future.then { x -> Future<Int> in
                results.append(x)
                return Future<Void>.reject(nil)
              }.then { _ in
                results.append(21)
              }.fail { _ in
                results.append(42)
              }.wrap()
            ]

            future.resolve(1)

            return futures
          }

          expect(results) == [1, 42]
        }
      }
    }
    
    describe("Future#finally") {
      var future: Future<Void>!
      var thenCalled: Bool = false
      var failedCalled: Bool = false
