Skip to content
Myr

test.command.executableSubcommandSpecifySubcommand.js

This file

Path

test/test.command.executableSubcommandSpecifySubcommand.js

44 lines · 1.2 KiB · JavaScript

Last changed by

Merge pull request #999 from shadowspawn/feature/specifyExecutableFileJohn Geebefore adoption831d52f

History of this file

Take it

Merge pull request #999 from shadowspawn/feature/specifyExecutableFileJohn Geebefore adoption831d52f

lines 1–44why, one step back
1var exec = require('child_process').exec
2 , path = require('path')3 , should = require('should');4567var bin = path.join(__dirname, './fixtures/pm')8// success case9exec(bin + ' specifyInstall', function(error, stdout, stderr) {10 // Optionally specify `pm-install`11 stdout.should.equal('install\n');12});13exec(bin + ' specifyPublish', function(error, stdout, stderr) {14 // Optionally specify `pm-publish`15 stdout.should.equal('publish\n');16});1718// not exist19exec(bin + ' list', function (error, stdout, stderr) {20 //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n');21 should.notEqual(0, stderr.length);22});2324// success case25exec(bin + ' install', function (error, stdout, stderr) {26 stdout.should.equal('install\n');27});2829// subcommand bin file with explicit extension30exec(bin + ' publish', function (error, stdout, stderr) {31 stdout.should.equal('publish\n');32});3334// spawn EACCES35exec(bin + ' search', function (error, stdout, stderr) {36 should.notEqual(0, stderr.length);37});3839// when `bin` is a symbol link for mocking global install40var bin = path.join(__dirname, './fixtures/pmlink')41// success case42exec(bin + ' install', function (error, stdout, stderr) {43 stdout.should.equal('install\n');44});