       atomHome = temp.mkdirSync('apm-home-dir-')
       process.env.ATOM_HOME = atomHome
       process.env.ATOM_NODE_URL = "http://localhost:3000/node"
-
-      spyOn(console, 'log')
-      spyOn(console, 'error')
 
     afterEach ->
       server.close()


  describe 'when an unrecognized command is specified', ->
    it 'prints an error message', ->
      spyOn(console, 'log')
      spyOn(console, 'error')
      apm.run(['this-will-never-be-a-command'])
      expect(console.log).not.toHaveBeenCalled()
      expect(console.error).toHaveBeenCalled()


describe 'apm command line interface', ->
  beforeEach ->
    spyOn(console, 'log')
    spyOn(console, 'error')
    spyOn(process.stdout, 'write')
    spyOn(process.stderr, 'write')

  describe 'when no arguments are present', ->
    it 'prints a usage message', ->
      apm.run([])
      expect(console.log).not.toHaveBeenCalled()
      expect(console.error).toHaveBeenCalled()
