Skip to content
Myr

test.command.name.js

This file

Path

test/test.command.name.js

24 lines · 608 bytes · JavaScript

Last changed by

fix testsusmonsterbefore adoptiondcddf69

History of this file

Take it

Merge pull request #264 from tonylukasavage/name_funcThomas Geraghtybefore adoptionf1d6a0c

line 1why, one step back
1var program = require('../')

Merge pull request #382 from claylo/masterRandall Koutnikbefore adoptionb91f7db

line 2why, one step back
2 , sinon = require('sinon').sandbox.create()

Merge pull request #264 from tonylukasavage/name_funcThomas Geraghtybefore adoptionf1d6a0c

lines 3–4why, one step back
3 , should = require('should');
4

Merge pull request #382 from claylo/masterRandall Koutnikbefore adoptionb91f7db

lines 5–7why, one step back
5sinon.stub(process, 'exit');
6sinon.stub(process.stdout, 'write');7

Merge pull request #264 from tonylukasavage/name_funcThomas Geraghtybefore adoptionf1d6a0c

lines 8–12why, one step back
8program
9 .command('mycommand [options]', 'this is my command');1011program.parse(['node', 'test']);12

fix testsusmonsterbefore adoptiondcddf69

line 13why, one step back
13program.name.should.be.a.Function();

Merge pull request #264 from tonylukasavage/name_funcThomas Geraghtybefore adoptionf1d6a0c

lines 14–16why, one step back
14program.name().should.equal('test');
15program.commands[0].name().should.equal('mycommand');16program.commands[1].name().should.equal('help');

Merge pull request #382 from claylo/masterRandall Koutnikbefore adoptionb91f7db

lines 17–24why, one step back
17
18var output = process.stdout.write.args[0];1920output[0].should.containEql([21 ' mycommand [options] this is my command'22].join('\n'));2324sinon.restore();