     buffer = project.bufferForPathSync(filePath)
 
   afterEach ->
-    buffer?.release()
+    buffer?.destroy()
 
   describe 'constructor', ->
     beforeEach ->
-      buffer.release()
+      buffer.destroy()
       buffer = null
 
     describe "when given a path", ->

            expect(buffer.getText()).toBe "\ninitialtexthello\n1\n2\n"

  describe "serialization", ->
    buffer2 = null

    afterEach ->
      buffer2?.release()

    describe "when the serialized buffer had no unsaved changes", ->
      it "loads the current contents of the file at the serialized path", ->
        expect(buffer.isModified()).toBeFalsy()

        buffer.getState().serializeForPersistence()
        state = buffer.getState().clone()
        state.get('text').insertTextAtPoint([0, 0], 'simulate divergence of on-disk contents from serialized contents')

        buffer2 = project.addBuffer(new TextBuffer(state))

        waitsForPromise ->
          buffer2.load()

    describe "when the serialized buffer had unsaved changes", ->
      describe "when the disk contents were changed since serialization", ->
        it "loads the disk contents instead of the previous unsaved state", ->
          buffer.setText("BUFFER CHANGE")
          fs.writeFileSync(filePath, "DISK CHANGE")

          project2 = atom.replicate().get('project')
          buffer2 = project2.getBuffers()[0]

          waitsFor ->
            buffer2.cachedDiskContents
