@@ -23,65 +23,61 @@ exports = module.exports = function (Gulp, util) {
2323 util . rimraf ( test . dirname , done ) ;
2424 } ) ;
2525
26- var gulp = Gulp . create ( ) ;
27-
2826 it ( '--silent should turn off logging' , function ( done ) {
29- gulp . stack ( '--silent' , {
30- onHandleError : done ,
31- onHandleEnd : function ( ) {
32- should ( this . log ) . be . eql ( false ) ;
33- done ( ) ;
34- gulp . log = true ;
35- }
36- } ) ( ) ;
27+ var gulp = Gulp . create ( ) ;
28+
29+ gulp . log . should . be . eql ( true ) ;
30+
31+ gulp . start ( [ '--silent' ] , function ( error ) {
32+ if ( error ) { return done ( error ) ; }
33+ should ( gulp . log ) . be . eql ( false ) ;
34+ done ( ) ;
35+ } ) ;
3736 } ) ;
3837
3938 it ( '--no-color should turn colors off' , function ( done ) {
40- gulp . stack ( '--no-color' , {
41- onHandleError : done ,
42- onHandleEnd : function ( ) {
43- should ( util . lib . chalk ) . have . property ( 'enabled' , false ) ;
44- done ( ) ;
45- }
46- } ) ( ) ;
39+ var gulp = Gulp . create ( ) ;
40+
41+ gulp . start ( [ '--no-color' ] , function ( error ) {
42+ if ( error ) { return done ( error ) ; }
43+ should ( util . lib . chalk ) . have . property ( 'enabled' , false ) ;
44+ done ( ) ;
45+ } ) ;
4746 } ) ;
4847
4948 it ( '--color should restore them' , function ( done ) {
50- gulp . stack ( '--color' , {
51- onHandleError : done ,
52- onHandleEnd : function ( ) {
53- should ( util . lib . chalk ) . have . property ( 'enabled' , true ) ;
54- done ( ) ;
55- }
56- } ) ( ) ;
49+ var gulp = Gulp . create ( ) ;
50+
51+ gulp . start ( [ '--color' ] , function ( error ) {
52+ if ( error ) { return done ( error ) ; }
53+ should ( util . lib . chalk ) . have . property ( 'enabled' , true ) ;
54+ done ( ) ;
55+ } ) ;
5756 } ) ;
5857
5958 it ( '--cwd :dirname should change cwd' , function ( done ) {
6059 var cwd = process . cwd ( ) ;
60+ var gulp = Gulp . create ( ) ;
6161
62- gulp . stack ( '--cwd ' + test . dirname , {
63- onHandleError : done ,
64- onHandleEnd : function ( ) {
65- should ( process . cwd ( ) ) . be . eql ( test . dirname ) ;
66- process . chdir ( cwd ) ; // restore previous working directory
67- done ( ) ;
68- }
69- } ) ( ) ;
62+ gulp . start ( [ '--cwd ' + test . dirname ] , function ( error ) {
63+ if ( error ) { return done ( error ) ; }
64+ should ( process . cwd ( ) ) . be . eql ( test . dirname ) ;
65+ process . chdir ( cwd ) ; // restore previous working directory
66+ done ( ) ;
67+ } ) ;
7068 } ) ;
7169
7270 it ( '--require should require a module from the cwd' , function ( done ) {
7371 var cwd = process . cwd ( ) ;
72+ var gulp = Gulp . create ( ) ;
73+
74+ should ( require . cache ) . not . have . property ( test . file ) ;
7475
75- gulp . stack ( '--require ' + test . file , {
76- onHandleError : done ,
77- onHandleStart : function ( ) {
78- should ( require . cache ) . not . have . property ( test . file ) ;
79- } ,
80- onHandleEnd : function ( ) {
81- should ( require . cache ) . have . property ( test . file ) ;
82- process . cwd ( ) . should . be . eql ( cwd ) ;
83- done ( ) ;
84- }
85- } ) ( ) ;
76+ gulp . start ( [ '--require ' + test . file ] , function ( error ) {
77+ if ( error ) { return done ( error ) ; }
78+ should ( require . cache ) . have . property ( test . file ) ;
79+ process . cwd ( ) . should . be . eql ( cwd ) ;
80+ done ( ) ;
81+ } ) ;
8682 } ) ;
8783} ;
0 commit comments