Remove excessive copyright/license boilerplate
[platform/upstream/nodejs.git] / test / parallel / test-child-process-env.js
1 var common = require('../common');
2 var assert = require('assert');
3
4 var spawn = require('child_process').spawn;
5
6 var isWindows = process.platform === 'win32';
7
8 var env = {
9   'HELLO': 'WORLD'
10 };
11 env.__proto__ = {
12   'FOO': 'BAR'
13 };
14
15 if (isWindows) {
16   var child = spawn('cmd.exe', ['/c', 'set'], {env: env});
17 } else {
18   var child = spawn('/usr/bin/env', [], {env: env});
19 }
20
21
22 var response = '';
23
24 child.stdout.setEncoding('utf8');
25
26 child.stdout.on('data', function(chunk) {
27   console.log('stdout: ' + chunk);
28   response += chunk;
29 });
30
31 process.on('exit', function() {
32   assert.ok(response.indexOf('HELLO=WORLD') >= 0);
33   assert.ok(response.indexOf('FOO=BAR') >= 0);
34 });