       expect(StatusBar.git.gitStatusIcon).toHaveClass('icon-diff-ignored')
 
     it "updates when a status-changed event occurs", ->
-      fs.writeSync(filePath, "i've changed for the worse")
+      fs.writeFileSync(filePath, "i've changed for the worse")
       atom.project.getRepo().getPathStatus(filePath)
       atom.rootView.openSync(filePath)
       expect(StatusBar.git.gitStatusIcon).toHaveClass('icon-diff-modified')
-      fs.writeSync(filePath, originalPathText)
+      fs.writeFileSync(filePath, originalPathText)
       atom.project.getRepo().getPathStatus(filePath)
       expect(StatusBar.git.gitStatusIcon).not.toHaveClass('icon-diff-modified')
 
     it "displays the diff stat for modified files", ->
-      fs.writeSync(filePath, "i've changed for the worse")
+      fs.writeFileSync(filePath, "i've changed for the worse")
       atom.project.getRepo().getPathStatus(filePath)
       atom.rootView.openSync(filePath)
       expect(StatusBar.git.gitStatusIcon).toHaveText('+1')


    beforeEach ->
      projectPath = atom.project.resolve('git/working-dir')
      fs.move(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
      atom.project.setPath(projectPath)
      filePath = atom.project.resolve('a.txt')
      newPath = atom.project.resolve('new.txt')
      fs.writeSync(newPath, "I'm new here")
      ignorePath = path.join(projectPath, '.gitignore')
      fs.writeSync(ignorePath, 'ignored.txt')
      ignoredPath = path.join(projectPath, 'ignored.txt')
      fs.writeSync(ignoredPath, '')
      atom.project.getRepo().getPathStatus(filePath)
      atom.project.getRepo().getPathStatus(newPath)
      originalPathText = fs.read(filePath)
      atom.rootView.attachToDom()

    afterEach ->
      fs.writeSync(filePath, originalPathText)
      fs.remove(newPath)
      fs.remove(ignorePath)
      fs.remove(ignoredPath)
      fs.move(path.join(projectPath, '.git'), path.join(projectPath, 'git.git'))

    it "displays the modified icon for a changed file", ->
      fs.writeSync(filePath, "i've changed for the worse")
      atom.project.getRepo().getPathStatus(filePath)
      atom.rootView.openSync(filePath)
      expect(StatusBar.git.gitStatusIcon).toHaveClass('icon-diff-modified')

  describe "when the buffer content has changed from the content on disk", ->
    it "disables the buffer modified indicator on save", ->
      filePath = path.join(os.tmpdir(), "atom-whitespace.txt")
      fs.writeFileSync(filePath, "")
      atom.rootView.openSync(filePath)
      editor = atom.rootView.getActiveView()
      expect(StatusBar.fileInfo.bufferModified.text()).toBe ''
