From: Cheng Zhao Date: Fri, 16 Aug 2013 10:51:51 +0000 (+0800) Subject: Add spec for child_process.fork. X-Git-Tag: v0.4.0~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=16d039ba471c4f59d2b7be7bb0a947f4ee3b737b;p=electron.git Add spec for child_process.fork. --- diff --git a/spec/fixtures/module/ping.js b/spec/fixtures/module/ping.js new file mode 100644 index 00000000..dc380a1a --- /dev/null +++ b/spec/fixtures/module/ping.js @@ -0,0 +1,3 @@ +process.on('message', function(msg) { + process.send(msg); +}); diff --git a/spec/node/child_process.coffee b/spec/node/child_process.coffee new file mode 100644 index 00000000..2246391b --- /dev/null +++ b/spec/node/child_process.coffee @@ -0,0 +1,14 @@ +assert = require 'assert' +child_process = require 'child_process' +path = require 'path' + +describe 'child_process', -> + fixtures = path.join __dirname, '..', 'fixtures' + + describe 'child_process.fork', -> + it 'should work', (done) -> + child = child_process.fork path.join(fixtures, 'module', 'ping.js') + child.on 'message', (msg) -> + assert.equal msg, 'message' + done() + child.send 'message'