Add spec for child_process.fork.

This commit is contained in:
Cheng Zhao 2013-08-16 18:51:51 +08:00
parent beb62566e4
commit 16d039ba47
2 changed files with 17 additions and 0 deletions

3
spec/fixtures/module/ping.js vendored Normal file
View file

@ -0,0 +1,3 @@
process.on('message', function(msg) {
process.send(msg);
});

View file

@ -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'