@@ -85,6 +85,52 @@ describe('gulp-css-base64', function () {
85
85
} ) ;
86
86
} ) ;
87
87
88
+ it ( 'should convert url() content with questionmark at end' , function ( done ) {
89
+ // create the fake file
90
+ var fakeFile = new gutil . File ( {
91
+ contents : new Buffer ( '.button_alert{background:url(\'test/fixtures/image/very-very-small.png?awesomeQuestionmark\') no-repeat 4px 5px;padding-left:12px;font-size:12px;color:#888;text-decoration:underline}' )
92
+ } ) ;
93
+
94
+ // Create a css-base64 plugin stream
95
+ var stream = base64 ( ) ;
96
+
97
+ // write the fake file to it
98
+ stream . write ( fakeFile ) ;
99
+
100
+ // wait for the file to come back out
101
+ stream . once ( 'data' , function ( file ) {
102
+ // make sure it came out the same way it went in
103
+ assert ( file . isBuffer ( ) ) ;
104
+
105
+ // check the contents
106
+ assert . equal ( file . contents . toString ( 'utf8' ) , '.button_alert{background:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANAQAAAABakNnRAAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAArSURBVAjXY/j/g2H/C4b5Jxj6OxgaOEBoxgmGDg8GIACyuRoYjkowfKgAACBpDLQ2kvRRAAAAAElFTkSuQmCC\') no-repeat 4px 5px;padding-left:12px;font-size:12px;color:#888;text-decoration:underline}' ) ;
107
+ done ( ) ;
108
+ } ) ;
109
+ } ) ;
110
+
111
+ it ( 'should convert url() content with hashtag at end' , function ( done ) {
112
+ // create the fake file
113
+ var fakeFile = new gutil . File ( {
114
+ contents : new Buffer ( '.button_alert{background:url(\'test/fixtures/image/very-very-small.png#awesomeHashtag\') no-repeat 4px 5px;padding-left:12px;font-size:12px;color:#888;text-decoration:underline}' )
115
+ } ) ;
116
+
117
+ // Create a css-base64 plugin stream
118
+ var stream = base64 ( ) ;
119
+
120
+ // write the fake file to it
121
+ stream . write ( fakeFile ) ;
122
+
123
+ // wait for the file to come back out
124
+ stream . once ( 'data' , function ( file ) {
125
+ // make sure it came out the same way it went in
126
+ assert ( file . isBuffer ( ) ) ;
127
+
128
+ // check the contents
129
+ assert . equal ( file . contents . toString ( 'utf8' ) , '.button_alert{background:url(\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANAQAAAABakNnRAAAAAmJLR0QAAKqNIzIAAAAJcEhZcwAAAEgAAABIAEbJaz4AAAArSURBVAjXY/j/g2H/C4b5Jxj6OxgaOEBoxgmGDg8GIACyuRoYjkowfKgAACBpDLQ2kvRRAAAAAElFTkSuQmCC\') no-repeat 4px 5px;padding-left:12px;font-size:12px;color:#888;text-decoration:underline}' ) ;
130
+ done ( ) ;
131
+ } ) ;
132
+ } ) ;
133
+
88
134
it ( 'should ignore if image weight is greater than maxWeightResource default value' , function ( done ) {
89
135
// create the fake file
90
136
var fakeFile = new gutil . File ( {
0 commit comments