 
   describe "the c keybinding", ->
     describe "when followed by a c", ->
+      beforeEach ->
+        editor.setText("12345\nabcde\nABCDE")
+
       it "deletes the current line and enters insert mode", ->
-        editor.setText("12345\nabcde\nABCDE")
-        editor.setCursorScreenPosition([1,1])
-
-        keydown('c', element: editor[0])
-        keydown('c', element: editor[0])
+        editor.setCursorScreenPosition([1,1])
+
+        keydown('c', element: editor[0])
+        keydown('c', element: editor[0])
+
         expect(editor.getText()).toBe "12345\nABCDE"
         expect(editor.getCursorScreenPosition()).toEqual([1,0])
         expect(editor).not.toHaveClass 'command-mode'
         expect(editor).toHaveClass 'insert-mode'
 
       it "deletes the last line and enters insert mode", ->
-        editor.setText("12345\nabcde\nABCDE")
         editor.setCursorScreenPosition([2,1])
-        keydown('c', element: editor[0])
-        keydown('c', element: editor[0])
+
+        keydown('c', element: editor[0])
+        keydown('c', element: editor[0])
+
         expect(editor.getText()).toBe "12345\nabcde"
         expect(editor.getCursorScreenPosition()).toEqual([1,0])
         expect(editor).not.toHaveClass 'command-mode'
         expect(editor).toHaveClass 'insert-mode'
 
-      describe "when the second c is prefixed by a count", ->
-        it "deletes n lines, starting from the current, and enters insert mode", ->
-          editor.setText("12345\nabcde\nABCDE\nQWERT")
-          editor.setCursorScreenPosition([1,1])
-
-          keydown('c', element: editor[0])
-          keydown('2', element: editor[0])
-          keydown('c', element: editor[0])
-
-          expect(editor.getText()).toBe "12345\nQWERT"
-          expect(editor.getCursorScreenPosition()).toEqual([1,0])
-          expect(editor).not.toHaveClass 'command-mode'
-          expect(editor).toHaveClass 'insert-mode'
+    describe "when the second c is prefixed by a count", ->
+      it "deletes n lines, starting from the current, and enters insert mode", ->
+        editor.setText("12345\nabcde\nABCDE\nQWERT")
+        editor.setCursorScreenPosition([1,1])
+
+        keydown('c', element: editor[0])
+        keydown('2', element: editor[0])
+        keydown('c', element: editor[0])
+
+        expect(editor.getText()).toBe "12345\nQWERT"
+        expect(editor.getCursorScreenPosition()).toEqual([1,0])
+        expect(editor).not.toHaveClass 'command-mode'
+        expect(editor).toHaveClass 'insert-mode'
 
     describe "when followed by an h", ->
       it "deletes the previous letter on the current line and enters insert mode", ->


        keydown('d', element: editor[0])
        keydown('d', element: editor[0])
        expect(editor.getText()).toBe "12345\n\nABCDE"
        expect(editor.getCursorScreenPosition()).toEqual([1,0])
        expect(vimState.getRegister('"').text).toBe "abcde\n"


    it "switches to insert mode and shifts to the right", ->
      editor.setCursorScreenPosition [0, 0]

      keydown('a', element: editor[0])

      expect(editor.getCursorScreenPosition()).toEqual [0,1]
