@@ -10,7 +10,7 @@ var path = require('path');
1010
1111describe ( 'flag: --gulpfile' , function ( ) {
1212
13- it ( 'Manually set path of gulpfile' , function ( done ) {
13+ it ( 'Manually set path of gulpfile using --gulpfile ' , function ( done ) {
1414 var gulpfilePath = 'test/fixtures/gulpfiles/gulpfile-2.js' ;
1515
1616 runner ( { verbose : false } )
@@ -39,4 +39,33 @@ describe('flag: --gulpfile', function() {
3939 }
4040 } ) ;
4141
42+ it ( 'Manually set path of gulpfile using -f' , function ( done ) {
43+ var gulpfilePath = 'test/fixtures/gulpfiles/gulpfile-2.js' ;
44+
45+ runner ( { verbose : false } )
46+ . gulp ( '-f' , gulpfilePath )
47+ . run ( cb ) ;
48+
49+ function cb ( err , stdout , stderr ) {
50+ expect ( err ) . toEqual ( null ) ;
51+ expect ( stderr ) . toEqual ( '' ) ;
52+
53+ var chgWorkdirLog = headLines ( stdout , 1 ) ;
54+ var workdir = path . dirname ( gulpfilePath ) . replace ( / \/ / g, path . sep ) ;
55+ expect ( chgWorkdirLog ) . toMatch ( 'Working directory changed to ' ) ;
56+ expect ( chgWorkdirLog ) . toMatch ( workdir ) ;
57+
58+ stdout = eraseLapse ( eraseTime ( skipLines ( stdout , 2 ) ) ) ;
59+ expect ( stdout ) . toEqual (
60+ 'Starting \'default\'...\n' +
61+ 'Starting \'logGulpfilePath\'...\n' +
62+ path . resolve ( gulpfilePath ) + '\n' +
63+ 'Finished \'logGulpfilePath\' after ?\n' +
64+ 'Finished \'default\' after ?\n' +
65+ ''
66+ ) ;
67+ done ( err ) ;
68+ }
69+ } ) ;
70+
4271} ) ;
0 commit comments