             
             describe("periodic fetching") {
                 var testStart: Date!
-                var valuesAndTimes = [(value: Int, time: Date)]()
                 
                 describe("when uninterupted") {
                     beforeEach {
                         futureIndex = 0
-                        
-                        futureGenerator = {
-                            let date = Date()
-                            let promise = Promise<Int>()
-                            
-                            if futureIndex == 0 || futureIndex % 2 == 0 {
-                                promise.resolve(futureIndex)
-                            }
-                            else {
-                                let error = NSError(domain: "Fail.", code: futureIndex, userInfo: nil)
-                                promise.reject(error)
-                            }
-                            
-                            valuesAndTimes.append((value: futureIndex, time: date))
-                            futureIndex += 1
-                            return promise.future
-                        }
-                        
+                        futureGenerator = alternateSucceedAndFailGenerator
                         timeInterval = 0.3
                         
                         testStart = Date()

                    }
                }
                
            }
            
        }

            promise.resolve(futureIndex)
            futureIndex += 1
            return promise.future
        }
        
        var valuesAndTimes = [(value: Int, time: Date)]()
        let alternateSucceedAndFailGenerator: PeriodicFetcher<Int>.FutureGenerator = {
                let date = Date()
                let promise = Promise<Int>()
                
                if futureIndex == 0 || futureIndex % 2 == 0 {
                    promise.resolve(futureIndex)
                }
                else {
                    let error = NSError(domain: "Fail.", code: futureIndex, userInfo: nil)
                    promise.reject(error)
                }
                
                valuesAndTimes.append((value: futureIndex, time: date))
                futureIndex += 1
                return promise.future
        }
        
        describe("PeriodicFetcher") {
