         """
 
         editorView.trigger 'find-and-replace:select-all'
-        expect(editor.getSelectedBufferRanges()).toEqual [
-          [[0, 0], [0, 3]]
-          [[3, 8], [3, 11]]
-          [[5, 6], [5, 9]]
-        ]
-
-        editorView.trigger 'find-and-replace:select-all'
-        expect(editor.getSelectedBufferRanges()).toEqual [
+        expect(getSelectedBufferRanges()).toEqual [
+          [[0, 0], [0, 3]]
+          [[3, 8], [3, 11]]
+          [[5, 6], [5, 9]]
+        ]
+
+        editorView.trigger 'find-and-replace:select-all'
+        expect(getSelectedBufferRanges()).toEqual [
           [[0, 0], [0, 3]]
           [[3, 8], [3, 11]]
           [[5, 6], [5, 9]]

        editor.setCursorBufferPosition([0, 0])

        editorView.trigger 'find-and-replace:select-next'
        expect(editor.getSelectedBufferRanges()).toEqual [
          [[0, 0], [0, 7]]
        ]

        editorView.trigger 'find-and-replace:select-next'
        expect(editor.getSelectedBufferRanges()).toEqual [
          [[0, 0], [0, 7]]
        ]


        editor.setSelectedBufferRange([[0, 0], [0, 3]])

        editorView.trigger 'find-and-replace:select-next'
        expect(getSelectedBufferRanges()).toEqual [
          [[0, 0], [0, 3]]
          [[3, 8], [3, 11]]
        ]

        editorView.trigger 'find-and-replace:select-next'
        expect(getSelectedBufferRanges()).toEqual [
          [[0, 0], [0, 3]]
          [[3, 8], [3, 11]]
          [[5, 6], [5, 9]]
        ]

        editorView.trigger 'find-and-replace:select-next'
        expect(getSelectedBufferRanges()).toEqual [
          [[0, 0], [0, 3]]
          [[3, 8], [3, 11]]
          [[5, 6], [5, 9]]
