 kd                 = require 'kd'
 expect             = require 'expect'
-sinon              = require 'sinon'
 globals            = require 'globals'
 AppController      = require '../lib/appcontroller'
 registerAppClass   = require '../lib/util/registerAppClass'


      isRegistered = no
      appInstance  = new AppController name: 'FooApp'
      sinon.spy(appManager, 'setListeners')

      appManager.on 'AppRegistered', -> isRegistered = yes
      appManager.register appInstance

      expect(appManager.appControllers.FooApp.instances).toInclude appInstance
      expect(appManager.setListeners.calledOnce).toBe yes
      expect(isRegistered).toBe yes




    it 'should warn if there is no name', ->

      expect.spyOn kd, 'warn'

      appManager.tell()

      expect(kd.warn).toHaveBeenCalled()


  describe '::create', ->
