Spy on ipc.send and make it synchronous

This commit is contained in:
Kevin Sawicki 2014-11-19 11:32:05 -08:00
parent 488abc8c24
commit 6d0be70dbc

View File

@ -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()