From c1929540a3ad9e7ede70bccda30726f98864d615 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Wed, 23 Apr 2014 16:35:51 -0700 Subject: [PATCH] Remove deprecated calls in pane view spec --- spec/pane-view-spec.coffee | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/spec/pane-view-spec.coffee b/spec/pane-view-spec.coffee index d58f6e2ef..da3105f1a 100644 --- a/spec/pane-view-spec.coffee +++ b/spec/pane-view-spec.coffee @@ -21,11 +21,16 @@ describe "PaneView", -> container = new PaneContainerView view1 = new TestView(id: 'view-1', text: 'View 1') view2 = new TestView(id: 'view-2', text: 'View 2') - editor1 = atom.project.openSync('sample.js') - editor2 = atom.project.openSync('sample.txt') - pane = container.getRoot() - paneModel = pane.model - paneModel.addItems([view1, editor1, view2, editor2]) + waitsForPromise -> + atom.workspace.open('sample.js').then (o) -> editor1 = o + + waitsForPromise -> + atom.workspace.open('sample.txt').then (o) -> editor2 = o + + runs -> + pane = container.getRoot() + paneModel = pane.model + paneModel.addItems([view1, editor1, view2, editor2]) afterEach -> atom.deserializers.remove(TestView) @@ -159,14 +164,20 @@ describe "PaneView", -> describe "when an unmodifed buffer's path is deleted", -> it "removes the pane item", -> + editor = null jasmine.unspy(window, 'setTimeout') filePath = temp.openSync('atom').path - editor = atom.project.openSync(filePath) - pane.activateItem(editor) - expect(pane.items).toHaveLength(5) - fs.removeSync(filePath) - waitsFor -> pane.items.length == 4 + waitsForPromise -> + atom.workspace.open(filePath).then (o) -> editor = o + + runs -> + pane.activateItem(editor) + expect(pane.items).toHaveLength(5) + fs.removeSync(filePath) + + waitsFor -> + pane.items.length == 4 describe "when a pane is destroyed", -> [pane2, pane2Model] = []