       end = false
       spy2 = jasmine.createSpy "mod spy"
       mod = (sb) ->
-        init: (opt, done)-> spy2(); done()
+        init: (opt, done)->
+          spy2()
+          setTimeout done, 0
         destroy: ->
       scaleApp.register "valid", @validModule
       scaleApp.register "x", mod

        x = false
        cb = -> x = true
        mod1 = (sb) ->
          init: (opt, done) -> setTimeout done, 1
          destroy: ->
        (expect scaleApp.register "anId", mod1).toBeTruthy()
        scaleApp.start "anId", { callback: cb }

      cb2 = jasmine.createSpy "second callback"

      mod1 = (sb) ->
        init: (opt, done)->
          setTimeout done, 0
          (expect finished).wasNotCalled()
        destroy: ->

      mod2 = (sb) ->
        init: (opt, done) ->
          setTimeout done, 0
          (expect finished).wasNotCalled()
        destroy: ->

      scaleApp.register "first", mod1, { callback: cb1 }
      scaleApp.register "second", mod2, { callback: cb2 }

      (expect scaleApp.startAll ["first","second"], ->
        finished()
        (expect cb1).wasCalled()
        (expect cb2).wasCalled()
        done()
      ).toBeTruthy()

    it "calls the callback with an error if one or more modules couldn't start", ->
      spy1 = jasmine.createSpy "mod1 spy"
