         should.not.exist err
         done()
 
-
 describe 'failures', ->
-  nsqdProcess = null
-
   before (done) ->
-    temp.mkdir '/nsq', (err, dirPath) ->
-      startNSQD dirPath, {}, (err, process) ->
-        nsqdProcess = process
+    temp.mkdir '/nsq', (err, dirPath) =>
+      startNSQD dirPath, {}, (err, process) =>
+        @nsqdProcess = process
         done err
 
   after (done) ->
-    nsqdProcess.kill()
+    @nsqdProcess.kill()
     # Give nsqd a chance to exit before it's data directory will be cleaned up.
     setTimeout done, 500
 

              should.exist err
              callback()
        ], (err) ->
          done()

            writer.on 'ready', ->
              callback()
          # Stop the nsqd process.
          (callback) =>
            @nsqdProcess.kill()
            setTimeout callback, 10
          # Attempt to publish a message.
          (callback) ->
