@@ -35,7 +35,7 @@ test('should write a bunch of files', function (t) {
35
35
copy ( inDir , outDir , function ( err , createdFiles ) {
36
36
t . error ( err )
37
37
t . ok ( Array . isArray ( createdFiles ) , 'createdFiles is an array' )
38
- t . equal ( createdFiles . length , 9 )
38
+ t . equal ( createdFiles . length , 10 )
39
39
checkCreatedFileNames ( createdFiles . map ( function ( filePath ) {
40
40
return path . relative ( outDir , filePath )
41
41
} ) , 'reported as created' )
@@ -101,3 +101,26 @@ test('should inject context variables strings into filenames', function (t) {
101
101
} ) )
102
102
} )
103
103
} )
104
+
105
+ test ( 'should inject context variables strings into directory names' , function ( t ) {
106
+ t . plan ( 4 )
107
+
108
+ const inDir = path . join ( __dirname , 'fixtures' )
109
+ const outDir = path . join ( __dirname , '../tmp' )
110
+ copy ( inDir , outDir , { foo : 'bar' } , function ( err ) {
111
+ t . error ( err )
112
+
113
+ readdirp ( { root : outDir } ) . pipe ( concat ( { object : true } , function ( arr ) {
114
+ t . ok ( Array . isArray ( arr ) , 'is array' )
115
+
116
+ const dir = path . join ( outDir , 'bar' )
117
+ fs . access ( dir , function ( err , chunk ) {
118
+ t . error ( err , 'bar directory exists' )
119
+
120
+ rimraf ( outDir , function ( err ) {
121
+ t . error ( err )
122
+ } )
123
+ } )
124
+ } ) )
125
+ } )
126
+ } )
0 commit comments