From 0794ea365d874fc8e97ef9c79641a48d6af4e0ab Mon Sep 17 00:00:00 2001 From: joshaber Date: Thu, 10 Dec 2015 16:43:25 -0500 Subject: [PATCH] Tinker tailor soldier spy. --- spec/git-repository-async-spec.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index 82d4b6f24..74bf8ef16 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -319,12 +319,15 @@ describe('GitRepositoryAsync', () => { editor.insertNewline() - let called - repository.onDidChangeStatus(c => called = c) + const statusHandler = jasmine.createSpy('statusHandler') + repository.onDidChangeStatus(statusHandler) editor.save() - waitsFor(() => Boolean(called)) - runs(() => expect(called).toEqual({path: editor.getPath(), pathStatus: 256})) + waitsFor(() => statusHandler.callCount > 0) + runs(() => { + expect(statusHandler.callCount).toBeGreaterThan(0) + expect(statusHandler).toHaveBeenCalledWith({path: editor.getPath(), pathStatus: 256}) + }) }) it('emits a status-changed event when a buffer is reloaded', async () => {