From 95b216f2345589aa36ea6801babb27bd6526a226 Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Wed, 9 Aug 2017 23:15:33 -0400 Subject: [PATCH] Add multiline spec --- spec/workspace-spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/workspace-spec.js b/spec/workspace-spec.js index bdd5677c8..add555f28 100644 --- a/spec/workspace-spec.js +++ b/spec/workspace-spec.js @@ -2394,6 +2394,22 @@ i = /test/; #FIXME\ expect(results[0].replacements).toBe(6) }) }) + + it('uses the multiline flag when searching', () => { + const filePath = path.join(projectDir, 'sample.js') + fs.copyFileSync(path.join(fixturesDir, 'sample.js'), filePath) + + const results = [] + waitsForPromise(() => + atom.workspace.replace(/;$/gi, 'items', [filePath], result => results.push(result)) + ) + + runs(() => { + expect(results).toHaveLength(1) + expect(results[0].filePath).toBe(filePath) + expect(results[0].replacements).toBe(8) + }) + }) }) describe('when a buffer is already open', () => {