           atom.packages.activatePackage("autocomplete-plus").then (a) ->
             mainModule = a.mainModule
 
-      waitsFor ->
-        mainModule.autocompleteManager?.ready
-
       runs ->
         autocompleteManager = mainModule.autocompleteManager
-
-      runs ->
         advanceClock 1
         editorView = atom.views.getView(editor)
 

          atom.packages.activatePackage("autocomplete-plus").then (a) ->
            mainModule = a.mainModule

      waitsFor ->
        mainModule.autocompleteManager?.ready

      runs ->
        autocompleteManager = mainModule.autocompleteManager

      runs ->
        advanceClock 1
        editorView = atom.views.getView(editor)


      workspaceElement = atom.views.getView(atom.workspace)
      jasmine.attachToDOM(workspaceElement)

  afterEach ->
    atom.config.set('autocomplete-plus.defaultProvider', 'Fuzzy')

