     describe "when the cursor is on the right side of an ending pair, the starting pair on another line", ->
       it "removes both pairs", ->
         editor.setCursorBufferPosition([7,5])
-        editorView.trigger "bracket-matcher:remove-matching-brackets"
+        atom.commands.dispatch(editorElement, "bracket-matcher:remove-matching-brackets")
         expect(editor.lineForBufferRow(4)).toEqual('    while(items.length > 0) ')
         expect(editor.lineForBufferRow(7)).toEqual('    ')
         expect(editor.getCursorBufferPosition()).toEqual([7,4])


    runs ->
      editorView = atom.workspaceView.getActiveView()
      editor = editorView.getModel()
      buffer = editor.getBuffer()



        runs ->
          editorView = atom.workspaceView.getActiveView()
          editorElement = editorView.element
          {editor} = editorView
          {buffer} = editor

