       runs -> expect(latex.showResult).toHaveBeenCalled();
 
     it "saves the file before building, if modified", ->
-      editor = atom.workspaceView.openSync("file.tex")
+      editor = atom.workspace.openSync("file.tex")
 
       editor.moveCursorToBottom()
       editor.insertNewline()

      expect(fakeInvoked).toEqual(false)

    it "runs `latexmk` for existing files", ->
      editor = atom.workspaceView.openSync("file.tex")
      [exitCode, done] = []

      spyOn(latex, "showResult").andCallFake -> done = true

      expect(editor.isModified()).toEqual(false)

    it "supports paths containing spaces", ->
      editor = atom.workspace.openSync("filename with spaces.tex")
      [exitCode, done] = []

      spyOn(latex, "showResult").andCallFake -> done = true
