2010-12-05 00:20:34 +01:00
|
|
|
var common = require('../common');
|
2010-12-05 20:15:30 +01:00
|
|
|
var assert = require('assert');
|
2010-08-17 19:07:45 +02:00
|
|
|
|
|
|
|
var stdout_write = global.process.stdout.write;
|
|
|
|
var strings = [];
|
|
|
|
global.process.stdout.write = function(string) {
|
2010-12-05 20:15:30 +01:00
|
|
|
strings.push(string);
|
2010-08-17 19:07:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
console.log('foo');
|
|
|
|
console.log('foo', 'bar');
|
|
|
|
console.log('%s %s', 'foo', 'bar', 'hop');
|
|
|
|
|
|
|
|
global.process.stdout.write = stdout_write;
|
|
|
|
assert.equal('foo\n', strings.shift());
|
|
|
|
assert.equal('foo bar\n', strings.shift());
|
|
|
|
assert.equal('foo bar hop\n', strings.shift());
|