@@ -57,6 +57,13 @@ module.exports = function (grunt) {
5757 cwd : 'test/fixtures' ,
5858 src : [ '*.js' ] ,
5959 dest : 'test/tmp/withSourceMaps'
60+ } ,
61+ withBasenameOption : {
62+ options : {
63+ basename : true
64+ } ,
65+ src : [ 'test/tmp/another.png' ] ,
66+ dest : 'test/tmp/relative'
6067 }
6168 } ,
6269 simplemocha : {
@@ -79,15 +86,32 @@ module.exports = function (grunt) {
7986 'jshint' ,
8087 'clean' ,
8188 'copy' ,
82- 'filerev' ,
89+ 'filerev:compile' ,
90+ 'filerev:withConfig' ,
91+ 'filerev:withDest' ,
92+ 'filerev:withExpand' ,
93+ 'filerev:withSummaryAttributeName' ,
94+ 'filerev:withSourceMaps' ,
8395 'checkSummary' ,
96+ 'clearSummary' ,
97+ 'filerev:withBasenameOption' ,
98+ 'checkBasenameSummary' ,
8499 'simplemocha' ,
85100 'clean'
86101 ] ) ;
87102
103+ grunt . registerTask ( 'clearSummary' , 'clear filerev summary' , function ( ) {
104+ grunt . filerev . summary = { } ;
105+ } ) ;
106+
88107 grunt . registerTask ( 'checkSummary' , 'Check that summary attribute is correctly created' , function ( ) {
89108 var src = path . normalize ( 'test/fixtures/file.png' ) ;
90109 var expected = path . normalize ( 'test/tmp/file.26365248.png' ) ;
91110 assert . equal ( grunt . filerev . summary [ src ] , expected ) ;
92111 } ) ;
112+
113+ grunt . registerTask ( 'checkBasenameSummary' , 'Check that summary attribute is correctly created' , function ( ) {
114+ assert . equal ( Object . keys ( grunt . filerev . summary ) [ 0 ] , 'another.png' ) ;
115+ assert . equal ( grunt . filerev . summary [ 'another.png' ] , 'another.92279d3f.png' ) ;
116+ } ) ;
93117} ;
0 commit comments