From d76940dabc05ef7967ecdce5d69cd4b351285c0e Mon Sep 17 00:00:00 2001 From: Robby Date: Sun, 6 Aug 2017 23:40:06 -0500 Subject: [PATCH] Adds another unit test --- spec/ex-commands-spec.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 2d9facc..2eb252a 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -984,12 +984,17 @@ describe "the commands", -> expect(calls[0].args[0].range).toEqual [0, 2] expect(calls[1].args[0].range).toEqual [3, 3] - desctibe ':sort', -> + describe ':sort', -> beforeEach -> - editor.setText('ghi\nabc\njkl\ndef\n') + editor.setText('ghi\nabc\njkl\ndef\n142\nzzz\n91xfds9\n') editor.setCursorBufferPosition([0, 0]) it "sorts entire file if range is not multi-line", -> openEx() submitNormalModeInputText('sort') - expect(atom.getText()).toEqual('abc\ndef\nghi\njkl\n') + expect(editor.getText()).toEqual('142\n91xfds9\nabc\ndef\nghi\njkl\nzzz\n') + + it "sorts specific range if range is multi-line", -> + openEx() + submitNormalModeInputText('2,4sort') + expect(editor.getText()).toEqual('ghi\nabc\ndef\njkl\n142\nzzz\n91xfds9\n')