 
     describe 'when --language=go option is given and the worker is 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(crossSpawnStub, 'spawn').callsFake( ->
           emitter = new EventEmitter
           emitter.stdout = new EventEmitter

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

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

net = require 'net'
{assert} = require 'chai'
clone = require 'clone'
childProcess = require('child_process')

crossSpawnStub = require('cross-spawn')
whichStub = require('../../src/which')
