@@ -325,25 +325,32 @@ describe('config/configuration', function() {
325325 } ) ;
326326
327327 describe ( 'extract' , function ( ) {
328- it ( 'should be check html files by default' , function ( ) {
328+ it ( 'should not check any files by default' , function ( ) {
329329 configuration . load ( { } ) ;
330- expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ '**/*.+(htm|html|xhtml)' ] ) ;
330+ expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ ] ) ;
331331 } ) ;
332332
333- it ( 'should set array of masks ' , function ( ) {
333+ it ( 'should check default files with value true ' , function ( ) {
334334 configuration . load ( {
335- extract : [ 'foo' , 'bar' ]
335+ extract : true
336336 } ) ;
337- expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ 'foo' , 'bar '] ) ;
337+ expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ '**/*.+(htm|html|xhtml) ' ] ) ;
338338 } ) ;
339339
340- it ( 'should set `never` ' , function ( ) {
340+ it ( 'should not check any files with value false ' , function ( ) {
341341 configuration . load ( {
342342 extract : false
343343 } ) ;
344344 expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ ] ) ;
345345 } ) ;
346346
347+ it ( 'should set array of masks and also check *.htm, *.html, *.xhtml' , function ( ) {
348+ configuration . load ( {
349+ extract : [ 'foo' , 'bar' ]
350+ } ) ;
351+ expect ( configuration . getExtractFileMasks ( ) ) . to . deep . equal ( [ 'foo' , 'bar' ] ) ;
352+ } ) ;
353+
347354 it ( 'should throw an exception when set wrong string value' , function ( ) {
348355 expect ( function ( ) {
349356 configuration . load ( {
@@ -354,38 +361,59 @@ describe('config/configuration', function() {
354361 } ) ;
355362
356363 describe ( 'shouldExtractFile' , function ( ) {
357- it ( 'should be check *.htm, *.html, *.xhtml by default' , function ( ) {
364+ it ( 'should not check anything by default' , function ( ) {
358365 configuration . load ( { } ) ;
359- expect ( ! ! configuration . shouldExtractFile ( 'file.htm' ) ) . to . equal ( true ) ;
360- expect ( ! ! configuration . shouldExtractFile ( 'file.html' ) ) . to . equal ( true ) ;
361- expect ( ! ! configuration . shouldExtractFile ( 'file.xhtml' ) ) . to . equal ( true ) ;
362- expect ( ! ! configuration . shouldExtractFile ( 'foo/file.htm' ) ) . to . equal ( true ) ;
363- expect ( ! ! configuration . shouldExtractFile ( 'foo/file.html' ) ) . to . equal ( true ) ;
364- expect ( ! ! configuration . shouldExtractFile ( 'foo/file.xhtml' ) ) . to . equal ( true ) ;
365- expect ( ! configuration . shouldExtractFile ( 'file.txt' ) ) . to . equal ( true ) ;
366- expect ( ! configuration . shouldExtractFile ( 'file.ht' ) ) . to . equal ( true ) ;
367- expect ( ! configuration . shouldExtractFile ( 'file.html.tmp' ) ) . to . equal ( true ) ;
368- expect ( ! configuration . shouldExtractFile ( 'smth.html/file.txt' ) ) . to . equal ( true ) ;
369- } ) ;
370-
371- it ( 'should set array of masks' , function ( ) {
366+ expect ( configuration . shouldExtractFile ( 'file.htm' ) ) . to . equal ( false ) ;
367+ expect ( configuration . shouldExtractFile ( 'file.html' ) ) . to . equal ( false ) ;
368+ expect ( configuration . shouldExtractFile ( 'file.xhtml' ) ) . to . equal ( false ) ;
369+ expect ( configuration . shouldExtractFile ( 'foo/file.htm' ) ) . to . equal ( false ) ;
370+ expect ( configuration . shouldExtractFile ( 'foo/file.html' ) ) . to . equal ( false ) ;
371+ expect ( configuration . shouldExtractFile ( 'foo/file.xhtml' ) ) . to . equal ( false ) ;
372+
373+ expect ( configuration . shouldExtractFile ( 'file.txt' ) ) . to . equal ( false ) ;
374+ expect ( configuration . shouldExtractFile ( 'file.ht' ) ) . to . equal ( false ) ;
375+ expect ( configuration . shouldExtractFile ( 'file.html.tmp' ) ) . to . equal ( false ) ;
376+ expect ( configuration . shouldExtractFile ( 'smth.html/file.txt' ) ) . to . equal ( false ) ;
377+ } ) ;
378+
379+ it ( 'should check *.htm, *.html, *.xhtml with value true' , function ( ) {
372380 configuration . load ( {
373- extract : [ 'foo' , 'bar' ]
381+ extract : true
374382 } ) ;
375- expect ( ! ! configuration . shouldExtractFile ( 'foo' ) ) . to . equal ( true ) ;
376- expect ( ! ! configuration . shouldExtractFile ( 'bar' ) ) . to . equal ( true ) ;
377- expect ( ! configuration . shouldExtractFile ( 'baz/foo' ) ) . to . equal ( true ) ;
378- expect ( ! configuration . shouldExtractFile ( 'foo/bar' ) ) . to . equal ( true ) ;
383+ expect ( configuration . shouldExtractFile ( 'file.htm' ) ) . to . equal ( true ) ;
384+ expect ( configuration . shouldExtractFile ( 'file.html' ) ) . to . equal ( true ) ;
385+ expect ( configuration . shouldExtractFile ( 'file.xhtml' ) ) . to . equal ( true ) ;
386+ expect ( configuration . shouldExtractFile ( 'foo/file.htm' ) ) . to . equal ( true ) ;
387+ expect ( configuration . shouldExtractFile ( 'foo/file.html' ) ) . to . equal ( true ) ;
388+ expect ( configuration . shouldExtractFile ( 'foo/file.xhtml' ) ) . to . equal ( true ) ;
389+
390+ expect ( configuration . shouldExtractFile ( 'file.txt' ) ) . to . equal ( false ) ;
391+ expect ( configuration . shouldExtractFile ( 'file.ht' ) ) . to . equal ( false ) ;
392+ expect ( configuration . shouldExtractFile ( 'file.html.tmp' ) ) . to . equal ( false ) ;
393+ expect ( configuration . shouldExtractFile ( 'smth.html/file.txt' ) ) . to . equal ( false ) ;
379394 } ) ;
380395
381- it ( 'should set `never` ' , function ( ) {
396+ it ( 'should set array of masks and also check *.htm, *.html, *.xhtml ' , function ( ) {
382397 configuration . load ( {
383- extract : false
398+ extract : [ 'foo' , 'bar' ]
384399 } ) ;
385- expect ( ! configuration . shouldExtractFile ( 'file.html' ) ) . to . equal ( true ) ;
386- expect ( ! configuration . shouldExtractFile ( 'foo/file.html' ) ) . to . equal ( true ) ;
387- expect ( ! configuration . shouldExtractFile ( 'file.html.tmp' ) ) . to . equal ( true ) ;
388- expect ( ! configuration . shouldExtractFile ( 'smth.html/file.txt' ) ) . to . equal ( true ) ;
400+ expect ( configuration . shouldExtractFile ( 'foo' ) ) . to . equal ( true ) ;
401+ expect ( configuration . shouldExtractFile ( 'bar' ) ) . to . equal ( true ) ;
402+
403+ expect ( configuration . shouldExtractFile ( 'baz/foo' ) ) . to . equal ( false ) ;
404+ expect ( configuration . shouldExtractFile ( 'foo/bar' ) ) . to . equal ( false ) ;
405+
406+ expect ( configuration . shouldExtractFile ( 'file.htm' ) ) . to . equal ( false ) ;
407+ expect ( configuration . shouldExtractFile ( 'file.html' ) ) . to . equal ( false ) ;
408+ expect ( configuration . shouldExtractFile ( 'file.xhtml' ) ) . to . equal ( false ) ;
409+ expect ( configuration . shouldExtractFile ( 'foo/file.htm' ) ) . to . equal ( false ) ;
410+ expect ( configuration . shouldExtractFile ( 'foo/file.html' ) ) . to . equal ( false ) ;
411+ expect ( configuration . shouldExtractFile ( 'foo/file.xhtml' ) ) . to . equal ( false ) ;
412+
413+ expect ( configuration . shouldExtractFile ( 'file.txt' ) ) . to . equal ( false ) ;
414+ expect ( configuration . shouldExtractFile ( 'file.ht' ) ) . to . equal ( false ) ;
415+ expect ( configuration . shouldExtractFile ( 'file.html.tmp' ) ) . to . equal ( false ) ;
416+ expect ( configuration . shouldExtractFile ( 'smth.html/file.txt' ) ) . to . equal ( false ) ;
389417 } ) ;
390418 } ) ;
391419
0 commit comments