Tinker tailor soldier spy.

This commit is contained in:
joshaber
2015-12-10 16:43:25 -05:00
parent bc14c28f11
commit 0794ea365d

View File

@@ -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 () => {