         expect(getHistory().entries).toHaveLength 2
 
     describe "when entries exceed max", ->
-      [history, commander, main, workspaceElement, editor, editorElement] = []
-
       data = [ "one", "two", "three" ]
-
       beforeEach ->
         workspaceElement = atom.views.getView(atom.workspace)
         commander = getCommander workspaceElement

        activationPromise
        atom.workspace.open(samplePath).then (_editor) ->
          editor          = _editor
          editorElement   = atom.views.getView(_editor)
          editorCommander = getCommander editorElement

      workspaceElement   = atom.views.getView(atom.workspace)
      workspaceCommander = getCommander workspaceElement

    moveTo = (point) ->
      editor.setCursorBufferPosition point

        expect(getMain().atomClipboardWrite).toEqual(atom.clipboard.write)

  describe "history", ->
    [history, commander, main, workspaceElement, editor, editorElement] = []

    beforeEach ->
      atom.config.set('clip-history.max', 3)
      waitsForPromise ->
        atom.packages.activatePackage 'clip-history'

    afterEach ->
      atom.packages.deactivatePackage 'clip-history'
