 
   describe "config defaults", ->
     it "uses the `editor.tabLength`, `editor.softWrap`, and `editor.softTabs` config values", ->
+      editor1 = null
+      editor2 = null
       atom.config.set('editor.tabLength', 4)
       atom.config.set('editor.softWrap', true)
       atom.config.set('editor.softTabs', false)
-      editor1 = atom.project.openSync('a')
-      expect(editor1.getTabLength()).toBe 4
-      expect(editor1.getSoftWrap()).toBe true
-      expect(editor1.getSoftTabs()).toBe false
-
-      atom.config.set('editor.tabLength', 100)
-      atom.config.set('editor.softWrap', false)
-      atom.config.set('editor.softTabs', true)
-      editor2 = atom.project.openSync('b')
-      expect(editor2.getTabLength()).toBe 100
-      expect(editor2.getSoftWrap()).toBe false
-      expect(editor2.getSoftTabs()).toBe true
+
+      waitsForPromise ->
+        atom.workspace.open('a').then (o) -> editor1 = o
+
+      runs ->
+        expect(editor1.getTabLength()).toBe 4
+        expect(editor1.getSoftWrap()).toBe true
+        expect(editor1.getSoftTabs()).toBe false
+
+        atom.config.set('editor.tabLength', 100)
+        atom.config.set('editor.softWrap', false)
+        atom.config.set('editor.softTabs', true)
+
+      waitsForPromise ->
+        atom.workspace.open('b').then (o) -> editor2 = o
+
+      runs ->
+        expect(editor2.getTabLength()).toBe 100
+        expect(editor2.getSoftWrap()).toBe false
+        expect(editor2.getSoftTabs()).toBe true
 
   describe "title", ->
     describe ".getTitle()", ->

        expect(selection.isEmpty()).toBeTruthy()

    it "does not share selections between different edit sessions for the same buffer", ->
      editor2 = atom.project.openSync('sample.js')
      editor.setSelectedBufferRanges([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
      editor2.setSelectedBufferRanges([[[8, 7], [6, 5]], [[4, 3], [2, 1]]])
      expect(editor2.getSelectedBufferRanges()).not.toEqual editor.getSelectedBufferRanges()

  describe "buffer manipulation", ->
    describe ".insertText(text)", ->

  describe "when the editor is deserialized", ->
    it "restores selections and folds based on markers in the buffer", ->
      editor.setSelectedBufferRange([[1, 2], [3, 4]])
      editor.addSelectionForBufferRange([[5, 6], [7, 5]], reversed: true)
      editor.foldBufferRow(4)
      expect(editor.isFoldedAtBufferRow(4)).toBeTruthy()

