diff --git a/spec/atom/buffer-spec.coffee b/spec/atom/buffer-spec.coffee index 91f362c18..16528ea15 100644 --- a/spec/atom/buffer-spec.coffee +++ b/spec/atom/buffer-spec.coffee @@ -192,7 +192,7 @@ describe 'Buffer', -> it "saves the contents of the buffer to the path", -> buffer = new Buffer() eventHandler = jasmine.createSpy('eventHandler') - buffer.on 'path-changed', eventHandler + buffer.on 'path-change', eventHandler buffer.setText 'Buffer contents!' buffer.saveAs(filePath) @@ -405,9 +405,9 @@ describe 'Buffer', -> expect(buffer.positionForCharacterIndex(408)).toEqual [12, 2] - describe "path-changed event", -> - it "emits path-changed event when path is changed", -> + describe "path-change event", -> + it "emits path-change event when path is changed", -> eventHandler = jasmine.createSpy('eventHandler') - buffer.on 'path-changed', eventHandler + buffer.on 'path-change', eventHandler buffer.setPath("moo.text") expect(eventHandler).toHaveBeenCalledWith(buffer) diff --git a/spec/atom/editor-spec.coffee b/spec/atom/editor-spec.coffee index bbc68fcbd..3b39485ad 100644 --- a/spec/atom/editor-spec.coffee +++ b/spec/atom/editor-spec.coffee @@ -21,7 +21,7 @@ describe "Editor", -> describe "construction", -> it "assigns an empty buffer and correctly handles text input (regression coverage)", -> editor = new Editor - expect(editor.buffer.path).toBeUndefined() + expect(editor.buffer.getPath()).toBeUndefined() expect(editor.lines.find('.line').length).toBe 1 editor.insertText('x') expect(editor.lines.find('.line').length).toBe 1 @@ -1772,7 +1772,7 @@ describe "Editor", -> beforeEach -> tempFilePath = '/tmp/atom-temp.txt' editor.setBuffer new Buffer(tempFilePath) - expect(editor.buffer.path).toBe tempFilePath + expect(editor.buffer.getPath()).toBe tempFilePath afterEach -> expect(fs.remove(tempFilePath)) @@ -1790,7 +1790,7 @@ describe "Editor", -> selectedFilePath = null beforeEach -> editor.setBuffer new Buffer() - expect(editor.buffer.path).toBeUndefined() + expect(editor.buffer.getPath()).toBeUndefined() editor.buffer.setText 'Save me to a new path' spyOn($native, 'saveDialog').andCallFake -> selectedFilePath diff --git a/src/atom/buffer.coffee b/src/atom/buffer.coffee index e1d3ca0b3..80a358f47 100644 --- a/src/atom/buffer.coffee +++ b/src/atom/buffer.coffee @@ -27,7 +27,7 @@ class Buffer setPath: (path) -> @url = path # we want this to be path on master, but let's not break it on a branch @path = path - @trigger "path-changed", this + @trigger "path-change", this getText: -> @lines.join('\n')