shelljs/test/echo.js
2012-03-02 09:50:25 -05:00

27 lines
468 B
JavaScript

var shell = require('..');
var assert = require('assert'),
path = require('path'),
fs = require('fs');
// Node shims for < v0.7
fs.existsSync = fs.existsSync || path.existsSync;
shell.silent();
function numLines(str) {
return typeof str === 'string' ? str.match(/\n/g).length : 0;
}
shell.rm('-rf', 'tmp');
shell.mkdir('tmp')
//
// Valids
//
assert.equal(shell.echo('hello world'), 'hello world');
assert.equal(shell.error(), null);
shell.exit(123);