test.command.executableSubcommand.js
This file
Path
test/test.command.executableSubcommand.js
31 lines · 929 bytes · JavaScript
Last changed by
Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
History of this fileTake it
Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 1–2why, one step back1var exec = require('child_process').exec2 , path = require('path')Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
lines 3–4why, one step back3 , should = require('should');4Merge pull request #332 from zhiyelee/fixexitZhiye Libefore adoption29b4ea9
line 5why, one step back5Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 6why, one step back6Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 7–13why, one step back7var bin = path.join(__dirname, './fixtures/pm')8// not exist9exec(bin + ' list', function (error, stdout, stderr) {10 //stderr.should.equal('\n pm-list(1) does not exist, try --help\n\n');11 // TODO error info are not the same in between <=v0.8 and later version12 should.notEqual(0, stderr.length);13});Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 14why, one step back14Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 15–17why, one step back15// success case16exec(bin + ' install', function (error, stdout, stderr) {17 stdout.should.equal('install\n');Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
lines 18–19why, one step back18});19Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 20–24why, one step back20// spawn EACCES21exec(bin + ' search', function (error, stdout, stderr) {22 // TODO error info are not the same in between <v0.10 and v0.1223 should.notEqual(0, stderr.length);24});Merge pull request #324 from zhiyelee/ttZhiye Libefore adoption2051ab0
line 25why, one step back25Merge pull request #349 from zhiyelee/fix-globalZhiye Libefore adoption1ebf2a4
lines 26–31why, one step back26// when `bin` is a symbol link for mocking global install27var bin = path.join(__dirname, './fixtures/pmlink')28// success case29exec(bin + ' install', function (error, stdout, stderr) {30 stdout.should.equal('install\n');31});