     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.release()
-
-          filePath = temp.openSync('atom').path
-          fs.writeFileSync(filePath, "words")
-          buffer = project.addBuffer(new TextBuffer({filePath}))
           buffer.setText("BUFFER CHANGE")
-
-          buffer.getState().serializeForPersistence()
-          state = buffer.getState().clone()
-          expect(state.getObject('text')).toBe 'BUFFER CHANGE'
           fs.writeFileSync(filePath, "DISK CHANGE")
 
-          buffer2 = project.addBuffer(new TextBuffer(state))
+          project2 = atom.replicate().get('project')
+          buffer2 = project2.getBuffers()[0]
 
           waitsFor ->
             buffer2.cachedDiskContents

        it "restores the previous unsaved state of the buffer", ->
          previousText = buffer.getText()
          buffer.setText("abc")

          buffer.getState().serializeForPersistence()
          state = buffer.getState().clone()
          expect(state.getObject('text')).toBe 'abc'

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

          waitsForPromise ->
            buffer2.load()

    buffer = project.bufferForPathSync(filePath)

  afterEach ->
    buffer?.destroy()

  describe 'constructor', ->
    beforeEach ->
      buffer.destroy()
      buffer = null

    describe "when given a path", ->
