   ensureOverwriteClass = (target, bool) ->
     className = 'vim-mode-plus-move-selected-text-overwrite'
     expect(target.classList.contains(className)).toBe(bool)
+
+  getEnsureWithOptions = (optionsBase) ->
+    (keystroke, options) ->
+      ensure(keystroke, _.defaults(_.clone(options), optionsBase))
 
   beforeEach ->
     getVimState (state, vim) ->

      describe "overwrite: true", ->
        beforeEach ->
          setOverwriteConfig(true)

    describe "characterwise", ->
      describe "overwrite: false", ->
        beforeEach ->
          set
            text: """
            ooo
            xxx
            YYY
            ZZZ

            """
            cursor: [[0, 1], [2, 1]]

        it "move characterwise, support multiple selection", ->
          ensure 'v l',
            mode: ['visual', 'characterwise']
            selectedTextOrdered: ['oo', 'YY']
            selectedBufferRange: [
              [[0, 1], [0, 3]]
              [[2, 1], [2, 3]]
            ]
          ensure 'ctrl-j',
            selectedTextOrdered: ['oo', 'YY']
            selectedBufferRange: [
              [[1, 1], [1, 3]]
              [[3, 1], [3, 3]]
            ]
            text: """
            oxx
            xoo
            YZZ
            ZYY

            """
          ensure 'ctrl-j',
            selectedTextOrdered: ['oo', 'YY']
            text: """
            oxx
            xZZ
            Yoo
            Z__
             YY
            """.replace(/_/g, ' ')
      describe "overwrite: true", ->
        beforeEach ->
          setOverwriteConfig(true)

  describe "move left/right", ->
    textData = null
    describe "linewise", ->
      beforeEach ->
        textData = new TextData """
          line0
          line1
          line2

          """
        set
          text: textData.getRaw()
          cursor: [0, 0]

      describe "overwrite: false", ->
        it "indent/outdent", ->
          selectedText = "line0\nline1\n"
          ensure "V j", {selectedText, selectionIsReversed: false}
          ensure 'ctrl-l',
            selectedText: "  line0\n  line1\n"
            selectionIsReversed: false

          ensure '2 ctrl-l',
            selectedText: "      line0\n      line1\n"
            selectionIsReversed: false

          ensure '2 ctrl-h',
            selectedText: "  line0\n  line1\n"
            selectionIsReversed: false

          ensure 'ctrl-h',
            selectedText: "line0\nline1\n"
            selectionIsReversed: false

        it "[case-2] indent/outdent", ->
          text = """
            line0
              line1
                line2
            line3

            """
          set {text}
          ensure "V 3 j", selectedText: text
          newText = """
            line0
            line1
            line2
            line3

            """
          ensure '1 0 ctrl-h', text: newText, selectedText: newText
      describe "overwrite: true", ->
        beforeEach ->
          setOverwriteConfig(true)

    # TODO
    describe "characterwise", ->
      describe "overwrite: false", ->
      describe "overwrite: true", ->
        beforeEach ->
          setOverwriteConfig(true)

  describe "duplicate up/down", ->
    beforeEach ->

_ = require 'underscore-plus'
{inspect} = require 'util'

requireFrom = (pack, path) ->
