nci/test/commands/shell.js

32 lines
692 B
JavaScript
Raw Normal View History

2014-12-03 22:23:41 +00:00
'use strict';
var expect = require('expect.js'),
ShellCommand = require('../../lib/command/shell').Command;
describe('Shell command', function() {
var shellCommand;
it('Should be created without errors', function() {
shellCommand = new ShellCommand({
isEmit: true
});
});
it('Default shell should be sh', function() {
expect(shellCommand.shell).equal('/bin/sh');
});
it('echo "Hello world" should be done', function(done) {
var stdout = '';
shellCommand.on('stdout', function(data) {
stdout += data;
});
shellCommand.run({cmd: 'echo "Hello world"'}, function(err) {
expect(err).not.ok();
expect(stdout).equal('Hello world\n');
done();
});
});
});