Merge branch 'master' into ns-telepathic-atom-global

Conflicts:
	src/atom.coffee
This commit is contained in:
Nathan Sobo
2013-12-16 18:18:06 -07:00
12 changed files with 115 additions and 45 deletions

View File

@@ -555,3 +555,31 @@ describe "WorkspaceView", ->
expect(workspace.getActivePaneItem().getUri()).toBe 'b'
workspace.reopenItemSync()
expect(workspace.getActivePaneItem().getUri()).toBe 'a'
describe "core:close", ->
it "closes the active editor until there are none", ->
atom.project.openSync('../sample.txt')
expect(atom.workspaceView.getActivePane().getItems()).toHaveLength 1
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePane()).not.toBeDefined()
atom.workspaceView.trigger('core:close')
expect(atom.workspaceView.getActivePane()).not.toBeDefined()
describe "core:save", ->
it "saves active editor until there are none", ->
editor = atom.project.openSync('../sample.txt')
spyOn(editor, 'save')
atom.workspaceView.getActivePane().showItem(editor)
atom.workspaceView.trigger('core:save')
expect(editor.save).toHaveBeenCalled()
describe "core:save-as", ->
beforeEach ->
spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
it "saves active editor until there are none", ->
editor = atom.project.openSync('../sample.txt')
spyOn(editor, 'saveAs')
atom.workspaceView.getActivePane().showItem(editor)
atom.workspaceView.trigger('core:save-as')
expect(editor.saveAs).toHaveBeenCalled()