         expect(editor.tokenizedLineForScreenRow(0).tokens.length).toBeGreaterThan 1
 
   describe "auto-indent", ->
-    copyText = (text, {startColumn, textEditor}={}) ->
-      startColumn ?= 0
-      textEditor ?= editor
-      textEditor.setCursorBufferPosition([0, 0])
-      textEditor.insertText(text)
-      numberOfNewlines = text.match(/\n/g)?.length
-      endColumn = text.match(/[^\n]*$/)[0]?.length
-      textEditor.getLastSelection().setBufferRange([[0,startColumn], [numberOfNewlines,endColumn]])
-      textEditor.cutSelectedText()
-
     describe "editor.autoIndent", ->
       describe "when editor.autoIndent is false (default)", ->
         describe "when `indent` is triggered", ->

              console.log JSON.stringify(editor.lineTextForBufferRow(1))
              expect(editor.lineTextForBufferRow(1)).toBe("    y(); z();")

        describe "when config.autoIndentOnPaste is false", ->
          beforeEach ->
            atom.config.set("editor.autoIndentOnPaste", false)

          it "does not auto-indent the pasted text", ->

            ])

      describe ".pasteText()", ->
        copyText = (text, {startColumn, textEditor}={}) ->
          startColumn ?= 0
          textEditor ?= editor
          textEditor.setCursorBufferPosition([0, 0])
          textEditor.insertText(text)
          numberOfNewlines = text.match(/\n/g)?.length
          endColumn = text.match(/[^\n]*$/)[0]?.length
          textEditor.getLastSelection().setBufferRange([[0,startColumn], [numberOfNewlines,endColumn]])
          textEditor.cutSelectedText()

        it "pastes text into the buffer", ->
          atom.clipboard.write('first')
          editor.pasteText()
          expect(editor.lineTextForBufferRow(0)).toBe "var first = function () {"
          expect(editor.lineTextForBufferRow(1)).toBe "  var first = function(items) {"

        describe "when `autoIndentOnPaste` is true", ->
          beforeEach ->
            atom.config.set("editor.autoIndentOnPaste", true)

