   describe "whitespace.ensureSingleTrailingNewline config", ->
     [originalConfigValue] = []
     beforeEach ->
-      originalConfigValue = config.get("whitespace.ensureSingleTrailingNewline")
+      originalConfigValue = atom.config.get("whitespace.ensureSingleTrailingNewline")
       expect(originalConfigValue).toBe true
 
     afterEach ->
-      config.set("whitespace.ensureSingleTrailingNewline", originalConfigValue)
+      atom.config.set("whitespace.ensureSingleTrailingNewline", originalConfigValue)
 
     it "adds a trailing newline when there is no trailing newline", ->
       editor.insertText "foo"


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

      buffer.retain()
      editor.destroy()

    expect(editor.getText()).toBe "foo\nbar\n\nbaz"

    # works for buffers that are opened after extension is initialized
    editor = atom.project.openSync('sample.txt')
    editor.moveCursorToEndOfLine()
    editor.insertText("           ")

