     beforeEach ->
       originalTimeoutInterval = helpers.setTimeoutInterval(10000)
 
-      spyOn(composer, 'showResult').andCallThrough()
-      spyOn(latex, 'getOpener').andReturn()
+      spyOn(composer, 'showResult').andReturn()
+      spyOn(composer, 'showError').andReturn()
 
     afterEach ->
       helpers.setTimeoutInterval(originalTimeoutInterval)
 
     it "does nothing for new, unsaved files", ->
       spyOn(composer, 'build').andCallThrough()
-      spyOn(composer, 'showError').andCallThrough()
 
       [result] = []
       waitsForPromise ->


    it "does nothing for unsupported file extensions", ->
      spyOn(composer, 'build').andCallThrough()
      spyOn(composer, 'showError').andCallThrough()

      [editor, result] = []
      waitsForPromise ->


      runs ->
        expect(composer.showError).toHaveBeenCalled()

    it "treats missing result from parser as an error", ->
      spyOn(latex, 'getBuilder').andReturn(mockBuilder)

      mockBuilder.parseLogFile.andReturn(null)

      waitsForPromise ->
        atom.workspace.open('file.tex')

      runs ->
        composer.build()

      waitsFor ->
        composer.showError.callCount is 1

      runs ->
        expect(composer.showError).toHaveBeenCalled()
