 {assert} = require('chai')
 {exec} = require('child_process')
 express = require 'express'
-request = require 'request'
+
 
 
 PORT = '3333'
 
 describe.only "Command line interface", () ->
-  stderr = ''
-  stdout = ''
-  exitStatus = ''
-  requests = []
+
 
   describe "Arguments with existing bleurpint and responding server", () ->    
     describe "when executing the command and the server is responding as specified in the blueprint", () ->
+      stderr = ''
+      stdout = ''
+      exitStatus = null
+      requests = []
       
       before (done) ->
-
         cmd = "./bin/dredd ./test/fixtures/single_get.md http://localhost:#{PORT}"
         
         app = express()

            stderr = err

            if error
              exitStatus = error.status
          
          eventName = if process.version.split('.')[1] is '6' then 'exit' else 'close'
          
          cli.on eventName, (code) ->        
            server.close()
        
        server.on 'close', done

            stderr = err

            if error
              exitStatus = error.code
          
          eventName = if process.version.split('.')[1] is '6' then 'exit' else 'close'
          
          cli.on eventName, (code) ->
            exitStatus = code if exitStatus == null and code != undefined
            server.close()
        
        server.on 'close', done
