@@ -10,7 +10,7 @@ var path = require('path');
10
10
11
11
describe ( 'flag: --gulpfile' , function ( ) {
12
12
13
- it ( 'Manually set path of gulpfile' , function ( done ) {
13
+ it ( 'Manually set path of gulpfile using --gulpfile ' , function ( done ) {
14
14
var gulpfilePath = 'test/fixtures/gulpfiles/gulpfile-2.js' ;
15
15
16
16
runner ( { verbose : false } )
@@ -39,4 +39,33 @@ describe('flag: --gulpfile', function() {
39
39
}
40
40
} ) ;
41
41
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
+
42
71
} ) ;
0 commit comments