Use Atom::replicate for second project

This commit is contained in:
Kevin Sawicki 2013-11-14 12:48:33 -08:00
parent 3ec2378242
commit 7d87ae00ff
2 changed files with 4 additions and 3 deletions

View File

@ -699,11 +699,11 @@ describe "Pane", ->
it "focuses the pane after attach only if had focus when serialized", ->
reloadContainer = ->
projectState = project.serialize()
projectReplica = atom.replicate().get('project')
containerState = container.serialize()
container.remove()
project.destroy()
window.project = deserialize(projectState)
window.project = projectReplica
container = deserialize(containerState)
pane = container.getRoot()
container.attachToDom()

View File

@ -19,7 +19,8 @@ describe "Project", ->
it "destroys unretained buffers and does not include them in the serialized state", ->
project.bufferForPathSync('a')
expect(project.getBuffers().length).toBe 1
deserializedProject = deserialize(project.serialize())
atom.getWindowState().serializeForPersistence()
deserializedProject = atom.replicate().get('project')
expect(deserializedProject.getBuffers().length).toBe 0
expect(project.getBuffers().length).toBe 0