 
   describe "build", ->
     it "does nothing for new, unsaved files", ->
-      editor = atom.workspaceView.openSync()
+      editor = atom.workspace.openSync()
       fakeInvoked = false
       fake = -> fakeInvoked = true
 

      runs -> expect(latex.showResult).toHaveBeenCalled();

    it "saves the file before building, if modified", ->
      editor = atom.workspaceView.openSync("file.tex")

      editor.moveCursorToBottom()
      editor.insertNewline()

      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
