       disposable.dispose()
       done()
     causeFileToOpen()
-
-waitsForWindowOpen = (causeWindowOpenCalled) ->
-  waitsFor (done) ->
-    workspaceOpen = atom.workspace.open
-    atom.workspace.open = ->
-      delete atom.workspace.open
-      workspaceOpen.apply(this, arguments)
-      setImmediate(done)
-    causeWindowOpenCalled()
 
 clickEvent = (properties) ->
   event = $.Event('click')


    describe "opening existing opened files in existing split panes", ->
      beforeEach ->
        atom.project.setPaths([path1])

        jasmine.attachToDOM(workspaceElement)
        waitsForFileToOpen ->

            expect(treeView).toHaveFocus()

          it "doesn't open the file in the active pane", ->
            expect(atom.views.getView(treeView)).toHaveFocus()
            expect(activePaneItem.getPath()).toBe atom.project.getDirectories()[0].resolve('tree-view.js')

      describe "when a file is double-clicked", ->
        beforeEach ->
          atom.config.set "tree-view.alwaysOpenExisting", true
        activePaneItem = null

        beforeEach ->
