                             frameIndex += 1
                             controller.writeMatrix(NuimoLEDMatrix(string: String(count: frameIndex % 81, repeatedValue: Character("*"))), interval: 2.0)
                             nextFrame()
-                        })
+                        }
                     }
                     nextFrame()
                 },

                    controller.writeMatrix(NuimoLEDMatrix(string: String(count: 81, repeatedValue: Character("*"))), interval: 5.0)
                },
                onLEDMatrixDisplayed: {
                    after(2.0, {
                        controller.disconnect()
                        expectation.fulfill()
                    })
                }
            )
            controller.connect()
        })
        discovery.startDiscovery()
        waitForExpectationsWithTimeout(10.0, handler: {_ in discovery.stopDiscovery() })
    }

    func testNuimoControllerDisplaysLEDMatrixAnimation() {

                    var frameIndex = 0
                    var nextFrame = {}
                    nextFrame = {
                        after(sendFramesRepeatInterval) {
                            guard frameIndex < sendFramesCount else {
                                controller.disconnect()
                                expectation.fulfill()
