     editor.moveCursorToEndOfLine()
     editor.insertText("           ")
 
-    editor.getBuffer().save()
+    editor.save()
     expect(editor.getText()).toBe 'Some text.\n'
 
   describe "when the edit session is destroyed", ->

    it "trims GFM text with a single space", ->
      editor.setGrammar(grammar)
      editor.insertText "foo \nline break!"
      editor.getBuffer().save()
      expect(editor.getText()).toBe "foo\nline break!\n"

    it "leaves GFM text with double spaces alone", ->
      editor.setGrammar(grammar)
      editor.insertText "foo  \nline break!"
      editor.getBuffer().save()
      expect(editor.getText()).toBe "foo  \nline break!\n"

    it "trims GFM text with a more than two spaces", ->
      editor.setGrammar(grammar)
      editor.insertText "foo   \nline break!"
      editor.getBuffer().save()
      expect(editor.getText()).toBe "foo\nline break!\n"

      spyOn(fsUtils, 'write')
      config.set("whitespace.ensureSingleTrailingNewline", false)

      buffer.retain()
      editor.destroy()

