         it "returns a new edit session containing previously opened buffer and emits a 'editor-created' event", ->
           editor = atom.project.openSync(absolutePath)
           newBufferHandler.reset()
-          expect(project.openSync(absolutePath).buffer).toBe editor.buffer
-          expect(project.openSync('a').buffer).toBe editor.buffer
+          expect(atom.project.openSync(absolutePath).buffer).toBe editor.buffer
+          expect(atom.project.openSync('a').buffer).toBe editor.buffer
           expect(newBufferHandler).not.toHaveBeenCalled()
           expect(newEditSessionHandler).toHaveBeenCalledWith editor
 

    describe "when opening a previously opened path", ->
      it "does not create a new buffer", ->
        buffer = atom.project.bufferForPathSync("a").retain()
        expect(project.bufferForPathSync("a")).toBe buffer

        alternativeBuffer = atom.project.bufferForPathSync("b").retain().release()
        expect(alternativeBuffer).not.toBe buffer

    describe "when passed an absolute or relative path", ->
      it "returns an absolute path based on the atom.project's root", ->
        absolutePath = require.resolve('./fixtures/dir/a')
        expect(atom.project.resolve('a')).toBe absolutePath
        expect(atom.project.resolve(absolutePath + '/../a')).toBe absolutePath
        expect(atom.project.resolve('a/../a')).toBe absolutePath

    describe "when passed a uri with a scheme", ->
      it "does not modify uris that begin with a scheme", ->
        expect(atom.project.resolve('http://zombo.com')).toBe 'http://zombo.com'

  describe ".setPath(path)", ->
    describe "when path is a file", ->
      it "sets its path to the files parent directory and updates the root directory", ->
        atom.project.setPath(require.resolve('./fixtures/dir/a'))
        expect(atom.project.getPath()).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
        expect(atom.project.getRootDirectory().path).toEqual path.dirname(require.resolve('./fixtures/dir/a'))

    describe "when path is a directory", ->
      it "sets its path to the directory and updates the root directory", ->
        directory = fs.absolute(path.join(__dirname, 'fixtures', 'dir', 'a-dir'))
        atom.project.setPath(directory)
        expect(atom.project.getPath()).toEqual directory
        expect(atom.project.getRootDirectory().path).toEqual directory

    describe "when path is null", ->
      it "sets its path and root directory to null", ->
        atom.project.setPath(null)
        expect(atom.project.getPath()?).toBeFalsy()
        expect(atom.project.getRootDirectory()?).toBeFalsy()

  describe ".replace()", ->
    [filePath, commentFilePath, sampleContent, sampleCommentContent] = []

    beforeEach ->
      atom.project.setPath(atom.project.resolve('../'))

      filePath = atom.project.resolve('sample.js')
      commentFilePath = atom.project.resolve('sample-with-comments.js')
