mirror of https://github.com/lukechilds/node.git
Felix Geisendörfer
15 years ago
committed by
Ryan Dahl
6 changed files with 51 additions and 21 deletions
@ -0,0 +1,2 @@ |
|||||
|
var sys = require('sys'); |
||||
|
sys.puts('test'); |
@ -0,0 +1,19 @@ |
|||||
|
require('../common'); |
||||
|
var path = require('path') |
||||
|
, childProccess = require('child_process') |
||||
|
, fs = require('fs') |
||||
|
, stdoutScript = path.join(path.dirname(__dirname), 'fixtures/stdout.js') |
||||
|
, tmpFile = path.join(path.dirname(__dirname), 'fixtures/stdout.txt') |
||||
|
, cmd = process.argv[0]+' '+stdoutScript+' > '+tmpFile; |
||||
|
|
||||
|
try { |
||||
|
fs.unlinkSync(tmpFile); |
||||
|
} catch (e) {} |
||||
|
|
||||
|
childProccess.exec(cmd, function(err) { |
||||
|
if (err) throw err; |
||||
|
|
||||
|
var data = fs.readFileSync(tmpFile); |
||||
|
assert.equal(data, "test\n"); |
||||
|
fs.unlinkSync(tmpFile); |
||||
|
}); |
Loading…
Reference in new issue