From 348553049adc80c3a0bedaba100ba063b5a73b03 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 9 Mar 2017 19:29:45 -0800 Subject: [PATCH] update specs --- spec/workspace-spec.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spec/workspace-spec.js b/spec/workspace-spec.js index 43e4fbae4..b04d8cbd7 100644 --- a/spec/workspace-spec.js +++ b/spec/workspace-spec.js @@ -1336,7 +1336,9 @@ i = /test/; #FIXME\ it('calls the callback with all regex results in all files in the project', () => { const results = [] waitsForPromise(() => - atom.workspace.scan(/(a)+/, result => results.push(result)) + atom.workspace.scan( + /(a)+/, {leadingContextLineCount: 1, trailingContextLineCount: 1}, + result => results.push(result)) ) runs(() => { @@ -1349,14 +1351,16 @@ i = /test/; #FIXME\ lineTextOffset: 0, range: [[0, 0], [0, 3]], leadingContextLines: [], - trailingContextLines: [] + trailingContextLines: ['cc aa cc'] }) }) }) it('works with with escaped literals (like $ and ^)', () => { const results = [] - waitsForPromise(() => atom.workspace.scan(/\$\w+/, result => results.push(result))) + waitsForPromise(() => atom.workspace.scan( + /\$\w+/, {leadingContextLineCount: 1, trailingContextLineCount: 1}, + result => results.push(result))) runs(() => { expect(results.length).toBe(1) @@ -1368,7 +1372,7 @@ i = /test/; #FIXME\ lineText: 'dollar$bill', lineTextOffset: 0, range: [[2, 6], [2, 11]], - leadingContextLines: [], + leadingContextLines: ['cc aa cc'], trailingContextLines: [] }) })