         runner.run [test], hooksStub, done
 
       after () ->
-        runner.mocha.run.restore()
-        mocha.Suite.create.restore()
         suiteStub.addTest.restore()
         suiteStub.beforeAll.restore()
         suiteStub.afterAll.restore()
+        mocha.Suite.create.restore()
+        runner.mocha.run.restore()
 
       it 'should run mocha', () ->
         assert.ok runner.mocha.run.called


    describe 'Interact with #test', () ->

      test = ''
      runner = ''

      before (done) ->
        testFactory = new TestFactory()


    describe 'when test is valid', () ->

      runner = undefined
      beforeAllHook = undefined
      afterAllHook = undefined
      beforeHook = undefined
      afterHook = undefined
      runCallback = undefined

      before (done) ->
        testFactory = new TestFactory()
        test = testFactory.create()
        test.name = 'GET /machines -> 200'
        test.request.path = '/machines'
        test.request.method = 'GET'
        test.response.status = 200
        test.response.schema = """[
          type: 'string'
          name: 'string'
        ]"""

        options =
          server: "#{ABAO_IO_SERVER}"

