             done()
 
       after () ->
+        console.log.restore()
         runner.mocha.run.restore()
-        console.log.restore()
 
       it 'should not run mocha', () ->
         assert.notOk runner.mocha.run.called

        hooksStub.runBefore.restore()
        hooksStub.runAfter.restore()

        runCallback = ''

      it 'should generate beforeAll hooks', () ->
        mochaStub = runner.mocha


    describe 'run test with hooks only indicated by `hooks-only`', () ->

      suiteStub = 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 = {}

        options =
          server: "#{SERVER}"
          'hooks-only': true
