]> khamidou — GitHub mirrors - electron.git/commitdiff
Add spec for child_process.fork.
authorCheng Zhao <zcbenz@gmail.com>
Fri, 16 Aug 2013 10:51:51 +0000 (18:51 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Fri, 16 Aug 2013 10:51:51 +0000 (18:51 +0800)
spec/fixtures/module/ping.js [new file with mode: 0644]
spec/node/child_process.coffee [new file with mode: 0644]

diff --git a/spec/fixtures/module/ping.js b/spec/fixtures/module/ping.js
new file mode 100644 (file)
index 0000000..dc380a1
--- /dev/null
@@ -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 (file)
index 0000000..2246391
--- /dev/null
@@ -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'