           return linterRegistry.lint({onChange: false, editorLinter})
         ).then ->
           expect(timesTriggered).toBe(2)
-          expect(registryMessages[1]).toBe(message)
+          expect(registryMessages[0]).toBe(message)
 
-  describe '::deleteEditorMessages', ->
-    it 'removes messages for that editor', ->
+  describe '::deleteByBuffer', ->
+    it 'removes messages for that buffer', ->
       wasUpdated = 0
       {linterRegistry, editorLinter} = getLinterRegistry()
-      editor = editorLinter.editor
+      buffer = editorLinter.editor.getBuffer()
       linterRegistry.onDidUpdateMessages (linterInfo) ->
         messageRegistry.set(linterInfo)
-        expect(messageRegistry.hasChanged).toBe(true)
-        messageRegistry.updatePublic()
+        expect(messageRegistry.debouncedUpdate).toHaveBeenCalled()
+        messageRegistry.update()
       messageRegistry.onDidUpdateMessages ({messages}) ->
         wasUpdated = 1
         expect(objectSize(messages)).toBe(1)
-        messageRegistry.deleteEditorMessages({editor})
+        messageRegistry.deleteByBuffer(buffer)
       waitsForPromise ->
         linterRegistry.lint({onChange: false, editorLinter}).then ->
           expect(wasUpdated).toBe(1)

      {linterRegistry, editorLinter} = getLinterRegistry()
      linterRegistry.onDidUpdateMessages (linterInfo) ->
        messageRegistry.set(linterInfo)
        expect(messageRegistry.hasChanged).toBe(true)
        messageRegistry.updatePublic()
      messageRegistry.onDidUpdateMessages ({added, removed, messages}) ->
        wasUpdated = true
        expect(added.length).toBe(1)

      registryMessages = null
      linterRegistry.onDidUpdateMessages (linterInfo) ->
        messageRegistry.set(linterInfo)
        messageRegistry.update()

      messageRegistry.onDidUpdateMessages ({messages}) ->
        ++timesTriggered
