@@ -378,31 +378,31 @@ describe('gitremote()', function () {
378378
379379describe ( '$ cd non-git-dir && gitopen' , function ( ) {
380380 it ( '$ gitopen @hotoo' , function ( done ) {
381- child_process . exec ( 'cd .. && . /gitopen/bin/gitopen --verbose @hotoo' , function ( err , stdout ) {
381+ child_process . exec ( '. /gitopen/bin/gitopen --verbose @hotoo' , { cwd : '..' } , function ( err , stdout ) {
382382 should ( err ) . not . be . ok ( ) ;
383383 stdout . should . be . containEql ( 'URL: https://github.com/hotoo\n' ) ;
384384 done ( ) ;
385385 } ) ;
386386 } ) ;
387387
388388 it ( '$ gitopen @hotoo/gitopen' , function ( done ) {
389- child_process . exec ( 'cd .. && . /gitopen/bin/gitopen --verbose @hotoo/gitopen' , function ( err , stdout ) {
389+ child_process . exec ( '. /gitopen/bin/gitopen --verbose @hotoo/gitopen' , { cwd : '..' } , function ( err , stdout ) {
390390 should ( err ) . not . be . ok ( ) ;
391391 stdout . should . be . containEql ( 'URL: https://github.com/hotoo/gitopen\n' ) ;
392392 done ( ) ;
393393 } ) ;
394394 } ) ;
395395
396396 it ( '$ gitopen snippet' , function ( done ) {
397- child_process . exec ( 'cd .. && . /gitopen/bin/gitopen --verbose snippet' , function ( err , stdout ) {
397+ child_process . exec ( '. /gitopen/bin/gitopen --verbose snippet' , { cwd : '..' } , function ( err , stdout ) {
398398 should ( err ) . not . be . ok ( ) ;
399399 stdout . should . be . containEql ( 'URL: https://gist.github.com/\n' ) ;
400400 done ( ) ;
401401 } ) ;
402402 } ) ;
403403
404404 it ( '$ gitopen #1 SHOULD ERROR' , function ( done ) {
405- child_process . exec ( 'cd .. && . /gitopen/bin/gitopen --verbose "#1"' , function ( err ) {
405+ child_process . exec ( '. /gitopen/bin/gitopen --verbose "#1"' , { cwd : '..' } , function ( err ) {
406406 should ( err ) . be . ok ( ) ;
407407 done ( ) ;
408408 } ) ;
@@ -499,7 +499,7 @@ describe('$ gitopen', function () {
499499 git_command_case_in_subdir . forEach ( function ( testcase ) {
500500 var cmd = testcase [ 0 ] ? ' ' + testcase [ 0 ] : '' ;
501501 it ( '$ cd bin && gitopen' + cmd , function ( done ) {
502- child_process . exec ( 'cd bin && ./gitopen --verbose' + cmd , function ( err , stdout ) {
502+ child_process . exec ( './gitopen --verbose' + cmd , { cwd : './bin' } , function ( err , stdout ) {
503503 should ( err ) . not . be . ok ( ) ;
504504 stdout . should . be . containEql ( 'URL: ' + ( RE_URL . test ( testcase [ 1 ] ) ? testcase [ 1 ] : 'https://github.com' + testcase [ 1 ] ) + '\n' ) ;
505505 done ( ) ;
@@ -522,7 +522,7 @@ describe('$ hgopen', function () {
522522 hg_command_case . forEach ( function ( testcase ) {
523523 var cmd = testcase [ 0 ] ? ' "' + testcase [ 0 ] + '"' : '' ;
524524 it ( '$ hgopen' + cmd , function ( done ) {
525- child_process . exec ( 'cd test/hgssh && ../../bin/hgopen --verbose' + cmd , function ( err , stdout ) {
525+ child_process . exec ( '../../bin/hgopen --verbose' + cmd , { cwd : 'test/hgssh' } , function ( err , stdout ) {
526526 should ( err ) . not . be . ok ( ) ;
527527 stdout . should . be . containEql ( 'URL: ' + ( RE_URL . test ( testcase [ 1 ] ) ? testcase [ 1 ] : 'https://bitbucket.org' + testcase [ 1 ] ) + '\n' ) ;
528528 done ( ) ;
@@ -535,7 +535,7 @@ describe('$ hgopen', function () {
535535 hg_command_case . forEach ( function ( testcase ) {
536536 var cmd = testcase [ 0 ] ? ' "' + testcase [ 0 ] + '"' : '' ;
537537 it ( '$ hgopen' + cmd , function ( done ) {
538- child_process . exec ( 'cd test/hghttp && ../../bin/hgopen --verbose' + cmd , function ( err , stdout ) {
538+ child_process . exec ( '../../bin/hgopen --verbose' + cmd , { cwd : 'test/hghttp' } , function ( err , stdout ) {
539539 should ( err ) . not . be . ok ( ) ;
540540 stdout . should . be . containEql ( 'URL: ' + ( RE_URL . test ( testcase [ 1 ] ) ? testcase [ 1 ] : 'https://bitbucket.org' + testcase [ 1 ] ) + '\n' ) ;
541541 done ( ) ;
0 commit comments