Skip to content
Myr

test.command.executableSubcommand.js

This file

Path

test/test.command.executableSubcommand.js

20 lines · 461 bytes · JavaScript

Last changed by

Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0

History of this file

Take it

Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0

lines 1–20why, one step back
1var program = require('../')
2 , util = require('util')3 , should = require('should');45var oldError = console.error;6var err = '';7console.error = function (tpl, s) {8 err = util.format(tpl, s);9};10program11 .command('exec [options]', 'this is my command');1213program.parse('node test exec a'.split(' '));1415program.runningCommand.on('error', function() {16 err.should.equal('\n test-exec(1) does not exist, try --help\n');17});1819// @todo test `EACCES` error20