From 6d0be70dbc479f198ee034bb8b8d81232d18ccbe Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 19 Nov 2014 11:32:05 -0800 Subject: [PATCH] Spy on ipc.send and make it synchronous --- spec/text-editor-component-spec.coffee | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/text-editor-component-spec.coffee b/spec/text-editor-component-spec.coffee index 05a08339c..7176a511d 100644 --- a/spec/text-editor-component-spec.coffee +++ b/spec/text-editor-component-spec.coffee @@ -2686,6 +2686,10 @@ describe "TextEditorComponent", -> describe "middle mouse paste on Linux", -> it "pastes the previously selected text", -> + spyOn(require('ipc'), 'send').andCallFake (eventName, selectedText) -> + if eventName is 'write-text-to-selection-clipboard' + require('clipboard').writeText(selectedText, 'selection') + atom.clipboard.write('') component.listenForMiddleMousePaste()