This commit is contained in:
Xiaolong Wang 2016-04-24 15:39:57 -05:00
parent b763104cb2
commit 286db320a8

View file

@ -497,26 +497,43 @@ describe "the commands", ->
expect(atom.workspace.open).toHaveBeenCalled() expect(atom.workspace.open).toHaveBeenCalled()
describe ":split", -> describe ":split", ->
it "splits the current file upwards", -> it "splits the current file upwards/downward", ->
pane = atom.workspace.getActivePane() pane = atom.workspace.getActivePane()
spyOn(pane, 'splitUp').andCallThrough() if atom.config.get('ex-mode.splitbelow')
filePath = projectPath('split') spyOn(pane, 'splitDown').andCallThrough()
editor.saveAs(filePath) filePath = projectPath('split')
keydown(':') editor.saveAs(filePath)
submitNormalModeInputText('split') keydown(':')
expect(pane.splitUp).toHaveBeenCalled() submitNormalModeInputText('split')
expect(pane.splitDown).toHaveBeenCalled()
else
spyOn(pane, 'splitUp').andCallThrough()
filePath = projectPath('split')
editor.saveAs(filePath)
keydown(':')
submitNormalModeInputText('split')
expect(pane.splitUp).toHaveBeenCalled()
# FIXME: Should test whether the new pane contains a TextEditor # FIXME: Should test whether the new pane contains a TextEditor
# pointing to the same path # pointing to the same path
describe ":vsplit", -> describe ":vsplit", ->
it "splits the current file to the left", -> it "splits the current file to the left/right", ->
pane = atom.workspace.getActivePane() if atom.config.get('ex-mode.splitright')
spyOn(pane, 'splitLeft').andCallThrough() pane = atom.workspace.getActivePane()
filePath = projectPath('vsplit') spyOn(pane, 'splitRight').andCallThrough()
editor.saveAs(filePath) filePath = projectPath('vsplit')
keydown(':') editor.saveAs(filePath)
submitNormalModeInputText('vsplit') keydown(':')
expect(pane.splitLeft).toHaveBeenCalled() submitNormalModeInputText('vsplit')
expect(pane.splitLeft).toHaveBeenCalled()
else
pane = atom.workspace.getActivePane()
spyOn(pane, 'splitLeft').andCallThrough()
filePath = projectPath('vsplit')
editor.saveAs(filePath)
keydown(':')
submitNormalModeInputText('vsplit')
expect(pane.splitLeft).toHaveBeenCalled()
# FIXME: Should test whether the new pane contains a TextEditor # FIXME: Should test whether the new pane contains a TextEditor
# pointing to the same path # pointing to the same path