 net = require 'net'
 {assert} = require 'chai'
 clone = require 'clone'
+childProcess = require('child_process')
 
 crossSpawnStub = require('cross-spawn')
 whichStub = require('../../src/which')

        whichStub.which.restore()
        HooksWorkerClient.prototype.terminateHandler.restore()
        process.env.GOBIN = goBin

      it 'should spawn the server process with command "$GOBIN/goodman"', (done) ->
        loadWorkerClient (err) ->

          assert.include err.message, "composer require ddelnano/dredd-hooks-php --dev"
          done()

    describe 'when --language=go option is given and the worker is not installed', ->
      goBin = undefined
      goPath = undefined
      beforeEach ->
        goBin = process.env.GOBIN
        goPath = process.env.GOPATH
        process.env.GOBIN = '/dummy/gobin/path'
        delete process.env.GOPATH

        sinon.stub(whichStub, 'which').callsFake (command) -> false

        runner.hooks['configuration'] =
          options:
            language: 'go'
            hookfiles: 'gobinary'
      afterEach ->
        whichStub.which.restore()
        process.env.GOBIN = goBin
        process.env.GOPATH = goPath

      it 'should write a hint how to install', (done) ->
        loadWorkerClient (err) ->
