From b2e86c80c4ac5f4a307ae597d8ef8ce04d35b88f Mon Sep 17 00:00:00 2001 From: abe33 Date: Mon, 12 May 2014 00:06:13 +0200 Subject: [PATCH] Change test to cover all Selection::copy branches --- spec/editor-spec.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 05a41683c..004d8ba2f 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -2061,13 +2061,17 @@ describe "Editor", -> describe ".copySelectedText()", -> it "copies selected text onto the clipboard", -> + editor.setSelectedBufferRanges([[[0,4], [0,13]], [[1,6], [1, 10]], [[2,8], [2, 13]]]) + editor.copySelectedText() expect(buffer.lineForRow(0)).toBe "var quicksort = function () {" expect(buffer.lineForRow(1)).toBe " var sort = function(items) {" - expect(clipboard.readText()).toBe 'quicksort\nsort' + expect(buffer.lineForRow(2)).toBe " if (items.length <= 1) return items;" + expect(clipboard.readText()).toBe 'quicksort\nsort\nitems' expect(atom.clipboard.readWithMetadata().metadata.selections).toEqual([ 'quicksort' 'sort' + 'items' ]) describe ".pasteText()", ->