 
   beforeEach ->
     directory = temp.mkdirSync()
-    project.setPath(directory)
+    atom.project.setPath(directory)
     filePath = path.join(directory, 'atom-whitespace.txt')
     fs.writeFileSync(filePath, '')
     fs.writeFileSync(path.join(directory, 'sample.txt'), 'Some text.\n')
-    editor = project.openSync(filePath)
+    editor = atom.project.openSync(filePath)
     buffer = editor.getBuffer()
 
-    atom.activatePackage('whitespace')
+    atom.packages.activatePackage('whitespace')
 
   it "strips trailing whitespace before an editor saves a buffer", ->
-    config.set("whitespace.ensureSingleTrailingNewline", false)
+    atom.config.set("whitespace.ensureSingleTrailingNewline", false)
 
     # works for buffers that are already open when extension is initialized
     editor.insertText("foo   \nbar\t   \n\nbaz")


  describe "when the edit session is destroyed", ->
    beforeEach ->
      config.set("whitespace.ensureSingleTrailingNewline", false)

      buffer.retain()
      editor.destroy()

      expect(editor.getText()).toBe "\n"

    it "does not add trailing newline if ensureSingleTrailingNewline is false", ->
      atom.config.set("whitespace.ensureSingleTrailingNewline", false)

      editor.insertText "no trailing newline"
      editor.save()
