From 2c986fdbfc052e1ba1ce342d8ba9286f2162290d Mon Sep 17 00:00:00 2001 From: Corey Johnson & Kevin Sawicki Date: Fri, 22 Feb 2013 16:31:50 -0800 Subject: [PATCH] Fix race condition in spec --- spec/app/editor-spec.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/app/editor-spec.coffee b/spec/app/editor-spec.coffee index 17c89d3d2..0b9f3a877 100644 --- a/spec/app/editor-spec.coffee +++ b/spec/app/editor-spec.coffee @@ -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()