@@ -57,6 +57,13 @@ module.exports = function (grunt) {
57
57
cwd : 'test/fixtures' ,
58
58
src : [ '*.js' ] ,
59
59
dest : 'test/tmp/withSourceMaps'
60
+ } ,
61
+ withBasenameOption : {
62
+ options : {
63
+ basename : true
64
+ } ,
65
+ src : [ 'test/tmp/another.png' ] ,
66
+ dest : 'test/tmp/relative'
60
67
}
61
68
} ,
62
69
simplemocha : {
@@ -79,15 +86,32 @@ module.exports = function (grunt) {
79
86
'jshint' ,
80
87
'clean' ,
81
88
'copy' ,
82
- 'filerev' ,
89
+ 'filerev:compile' ,
90
+ 'filerev:withConfig' ,
91
+ 'filerev:withDest' ,
92
+ 'filerev:withExpand' ,
93
+ 'filerev:withSummaryAttributeName' ,
94
+ 'filerev:withSourceMaps' ,
83
95
'checkSummary' ,
96
+ 'clearSummary' ,
97
+ 'filerev:withBasenameOption' ,
98
+ 'checkBasenameSummary' ,
84
99
'simplemocha' ,
85
100
'clean'
86
101
] ) ;
87
102
103
+ grunt . registerTask ( 'clearSummary' , 'clear filerev summary' , function ( ) {
104
+ grunt . filerev . summary = { } ;
105
+ } ) ;
106
+
88
107
grunt . registerTask ( 'checkSummary' , 'Check that summary attribute is correctly created' , function ( ) {
89
108
var src = path . normalize ( 'test/fixtures/file.png' ) ;
90
109
var expected = path . normalize ( 'test/tmp/file.26365248.png' ) ;
91
110
assert . equal ( grunt . filerev . summary [ src ] , expected ) ;
92
111
} ) ;
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
+ } ) ;
93
117
} ;
0 commit comments