From 16d039ba471c4f59d2b7be7bb0a947f4ee3b737b Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 16 Aug 2013 18:51:51 +0800 Subject: [PATCH] Add spec for child_process.fork. --- spec/fixtures/module/ping.js | 3 +++ spec/node/child_process.coffee | 14 ++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 spec/fixtures/module/ping.js create mode 100644 spec/node/child_process.coffee 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' -- 2.43.0