Fix race condition in spec

This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-02-22 16:31:50 -08:00
parent 8e6ae81169
commit 2c986fdbfc

View File

@@ -308,10 +308,11 @@ describe "Editor", ->
spyOn(atom, "confirm")
contentsConflictedHandler = jasmine.createSpy("contentsConflictedHandler")
editSession.on 'contents-conflicted', contentsConflictedHandler
fs.write(path, "a file change")
waitsFor "file to trigger contents-changed event", (done) ->
editSession.one 'contents-conflicted', done
waitsFor ->
contentsConflictedHandler.callCount > 0
runs ->
expect(atom.confirm).toHaveBeenCalled()