         toggleOverwrite(vimState1.editorElement)
         els = (state.editorElement for state in [vimState1, vimState2, vimState3])
         els.push(editorElement)
-
-        for el in els
-          expect(el.classList.contains(overwriteClass)).toBe(true)
+        ensureOverwriteClass(el, true) for el in els
 
         atom.packages.deactivatePackage('vim-mode-plus-move-selected-text')
-        for el in els
-          expect(el.classList.contains(overwriteClass)).toBe(false)
+        ensureOverwriteClass(el, false) for el in els
 
   describe "move up/down", ->
     textData = null


toggleOverwrite = (target) ->
  dispatch(target, 'vim-mode-plus-user:move-selected-text-toggle-overwrite')

{getVimState, TextData, dispatch} = requireFrom 'vim-mode-plus', 'spec/spec-helper'


{inspect} = require 'util'

requireFrom = (pack, path) ->
  packPath = atom.packages.resolvePackagePath(pack)
