From cdd31d69a83906da68e6e70bfb08246cac4b41a2 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 16 Oct 2014 10:54:29 -0700 Subject: [PATCH] Add spec for joining from empty line --- spec/text-editor-spec.coffee | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index 4d4e10940..7b6fa6578 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -3430,6 +3430,13 @@ describe "TextEditor", -> editor.joinLines() expect(editor.lineTextForBufferRow(12)).toBe '};' + describe "when the line is empty", -> + it "joins the line below with the current line with no added space", -> + editor.setCursorBufferPosition([10]) + editor.joinLines() + expect(editor.lineTextForBufferRow(10)).toBe 'return sort(Array.apply(this, arguments));' + expect(editor.getCursorBufferPosition()).toEqual [10, 0] + describe "when text is selected", -> describe "when the selection does not span multiple lines", -> it "joins the line below with the current line separated by a space and retains the selected text", ->