Revert "Fix the specs."

This reverts commit 39dcd59994.
This commit is contained in:
joshaber
2016-03-25 15:41:05 -04:00
parent 952f4aae0e
commit 6b26863012
2 changed files with 12 additions and 16 deletions

View File

@@ -483,10 +483,9 @@ describe('GitRepositoryAsync', () => {
describe('buffer events', () => {
let repo
let workingDirectory
beforeEach(() => {
workingDirectory = copyRepository()
const workingDirectory = copyRepository()
atom.project.setPaths([workingDirectory])
// When the path is added to the project, the repository is refreshed. We
@@ -513,9 +512,10 @@ describe('GitRepositoryAsync', () => {
})
it('emits a status-changed event when a buffer is reloaded', async () => {
fs.writeFileSync(path.join(workingDirectory, 'other.txt'), 'changed')
const editor = await atom.workspace.open('other.txt')
fs.writeFileSync(editor.getPath(), 'changed')
const statusHandler = jasmine.createSpy('statusHandler')
repo.onDidChangeStatus(statusHandler)
editor.getBuffer().reload()

View File

@@ -290,11 +290,10 @@ describe "GitRepository", ->
expect(repo.isStatusNew(status)).toBe false
describe "buffer events", ->
[editor, workingDirectory] = []
[editor] = []
beforeEach ->
workingDirectory = copyRepository()
atom.project.setPaths([workingDirectory])
atom.project.setPaths([copyRepository()])
waitsForPromise ->
atom.workspace.open('other.txt').then (o) -> editor = o
@@ -311,16 +310,13 @@ describe "GitRepository", ->
it "emits a status-changed event when a buffer is reloaded", ->
fs.writeFileSync(editor.getPath(), 'changed')
waitsForPromise ->
atom.workspace.open(path.join(workingDirectory, 'other.txt')).then (o) -> editor = o
runs ->
statusHandler = jasmine.createSpy('statusHandler')
atom.project.getRepositories()[0].onDidChangeStatus statusHandler
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
expect(statusHandler).toHaveBeenCalledWith {path: editor.getPath(), pathStatus: 256}
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
statusHandler = jasmine.createSpy('statusHandler')
atom.project.getRepositories()[0].onDidChangeStatus statusHandler
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
expect(statusHandler).toHaveBeenCalledWith {path: editor.getPath(), pathStatus: 256}
editor.getBuffer().reload()
expect(statusHandler.callCount).toBe 1
it "emits a status-changed event when a buffer's path changes", ->
fs.writeFileSync(editor.getPath(), 'changed')