   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.writeSync(filePath, "")
+      fs.writeFileSync(filePath, "")
       atom.rootView.openSync(filePath)
       editor = atom.rootView.getActiveView()
       expect(StatusBar.fileInfo.bufferModified.text()).toBe ''


  describe "git branch label", ->
    beforeEach ->
      fs.remove(path.join(os.tmpdir(), '.git')) if fs.isDirectorySync(path.join(os.tmpdir(), '.git'))
      atom.rootView.attachToDom()

    it "displays the current branch for files in repositories", ->

      expect(StatusBar.git.gitStatusIcon).toHaveClass('icon-diff-ignored')

    it "updates when a status-changed event occurs", ->
      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.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.writeFileSync(filePath, "i've changed for the worse")
      atom.project.getRepo().getPathStatus(filePath)
      atom.rootView.openSync(filePath)
      expect(StatusBar.git.gitStatusIcon).toHaveText('+1')
