 # Refactoring status: 70%
 _ = require 'underscore-plus'
 {Range, Point} = require 'atom'
+{inspect} = require 'util'
 
 supportedModeClass = [
   'normal-mode'

      shouldNotContainClasses = _.difference(supportedModeClass, currentMode)
      for m in shouldNotContainClasses
        expect(@editorElement.classList.contains(m)).toBe(false)

    if o.classListContains?
      for klass in toArray(o.classListContains)
        expect(@editorElement.classList.contains(klass)).toBe(true)
        expect(@editorElement.classList.contains(klass)).toBe(true)

    if o.classListNotContains?
      for klass in toArray(o.classListNotContains)
        expect(@editorElement.classList.contains(klass)).toBe(false)
        expect(@editorElement.classList.contains(klass)).toBe(false)

  keystroke: (keys, {element}={}) =>
    # keys must be String or Array

    keydown keys, {element}
  else
    for key in keys.split('')
      event = {element}
      event.shift = true if key.match(/[A-Z]/)
      keydown key, event

toArray = (obj, cond=null) ->
  if _.isArray(cond ? obj) then obj else [obj]
