       editor.insertText "1  \n2\t  \n\t \n3\n"
 
       # move cursor to bottom for preventing effect of whitespace.ignoreWhitespaceOnCurrentLine
-      editor.moveCursorToBottom()
+      editor.moveToBottom()
       editor.save()
       expect(editor.getText()).toBe "1\n2\n\t \n3\n"
 

      editor.insertText "foo"
      editor.setCursorBufferPosition([0,0])
      editor.selectToEndOfLine()
      originalSelectionRange = editor.getSelection().getBufferRange()
      editor.save()
      newSelectionRange = editor.getSelection().getBufferRange()
      expect(originalSelectionRange).toEqual(newSelectionRange)

  describe "when 'whitespace.ensureSingleTrailingNewline' is false", ->

        editor = atom.workspace.open('sample.txt').then (o) -> editor = o

      runs ->
        editor.moveToEndOfLine()
        editor.insertText("           ")

        # move cursor to next line to avoid ignoreWhitespaceOnCurrentLine
        editor.moveToBottom()

        editor.save()
        expect(editor.getText()).toBe 'Some text.\n'
