         expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
 
       it "emits a warning notification when the user does not have permission", ->
-        spyOn(Pane::, 'saveActiveItem').andCallFake ->
+        spyOn(editor, 'save').andCallFake ->
           error = new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
           error.code = 'EACCES'
           error.path = '/Some/dir/and-a-file.js'

        expect(notification.getMessage()).toContain 'Unable to save'

      it "emits a warning notification when the file cannot be saved", ->
        spyOn(Pane::, 'saveActiveItem').andCallFake ->
          throw new Error("no one knows")

        save = -> atom.workspace.saveActivePaneItem()

        expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'

      it "emits a warning notification when the directory cannot be written to", ->
        spyOn(editor, 'save').andCallFake ->
          throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")

        atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
