@@ -103,6 +103,7 @@ function timing(testCase) {
103103 * Make temporary directories
104104 */
105105rimraf . sync ( t ( [ ] ) ) ;
106+ mkdirp . sync ( t ( [ '_omittedDir' ] ) ) ;
106107mkdirp . sync ( t ( [ 'depwatch' ] ) ) ;
107108mkdirp . sync ( t ( [ 'inputs' , 'level-1-1' ] ) ) ;
108109mkdirp . sync ( t ( [ 'inputs' , 'level-1-2' ] ) ) ;
@@ -135,6 +136,28 @@ describe('miscellanea', function () {
135136 } ) ;
136137 } ) ;
137138 } ) ;
139+ it ( 'Omits files starting with an underscore' , function ( done ) {
140+ w ( '_omitted.pug' , '.foo bar' ) ;
141+ w ( '_omitted.html' , '<p>output not written</p>' ) ;
142+
143+ run ( [ '_omitted.pug' ] , function ( err ) {
144+ if ( err ) return done ( err ) ;
145+ var html = r ( '_omitted.html' ) ;
146+ assert ( html === '<p>output not written</p>' ) ;
147+ done ( ) ;
148+ } ) ;
149+ } ) ;
150+ it ( 'Omits directories starting with an underscore' , function ( done ) {
151+ w ( '_omittedDir/file.pug' , '.foo bar' ) ;
152+ w ( '_omittedDir/file.html' , '<p>output not written</p>' ) ;
153+
154+ run ( [ '--no-debug' , '_omittedDir/file.pug' ] , function ( err , stdout ) {
155+ if ( err ) return done ( err ) ;
156+ var html = r ( '_omittedDir/file.html' ) ;
157+ assert . equal ( html , '<p>output not written</p>' ) ;
158+ done ( ) ;
159+ } ) ;
160+ } ) ;
138161} ) ;
139162
140163describe ( 'HTML output' , function ( ) {
@@ -335,12 +358,12 @@ describe('client JavaScript output', function () {
335358 return done ( ) ;
336359 } ) ;
337360 } ) ;
338- it ( '--name-after-file _InPuTwIthWEiRdNaMME .pug' , function ( done ) {
339- w ( '_InPuTwIthWEiRdNaMME .pug' , '.foo bar' ) ;
340- w ( '_InPuTwIthWEiRdNaMME .js' , 'throw new Error("output not written");' ) ;
341- run ( [ '--no-debug' , '--client' , '--name-after-file' , '_InPuTwIthWEiRdNaMME .pug' ] , function ( err , stdout , stderr ) {
361+ it ( '--name-after-file ·InPuTwIthWEiRdNaMME .pug' , function ( done ) {
362+ w ( '·InPuTwIthWEiRdNaMME .pug' , '.foo bar' ) ;
363+ w ( '·InPuTwIthWEiRdNaMME .js' , 'throw new Error("output not written");' ) ;
364+ run ( [ '--no-debug' , '--client' , '--name-after-file' , '·InPuTwIthWEiRdNaMME .pug' ] , function ( err , stdout , stderr ) {
342365 if ( err ) return done ( err ) ;
343- var template = Function ( '' , r ( '_InPuTwIthWEiRdNaMME .js' ) + ';return InputwithweirdnammeTemplate;' ) ( ) ;
366+ var template = Function ( '' , r ( '·InPuTwIthWEiRdNaMME .js' ) + ';return InputwithweirdnammeTemplate;' ) ( ) ;
344367 assert ( template ( ) === '<div class="foo">bar</div>' ) ;
345368 return done ( ) ;
346369 } ) ;
0 commit comments