This commit is contained in:
Ben Ogle 2014-12-15 17:42:38 -08:00
parent f199c71fa8
commit 5ff7a286fc

View File

@ -299,16 +299,12 @@ describe "WorkspaceView", ->
describe "saving the active item", ->
describe "saveActivePaneItem", ->
describe "when there is an error", ->
beforeEach ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
@ -317,7 +313,6 @@ describe "WorkspaceView", ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'