@@ -248,7 +248,7 @@ vows.describe('cleancss')
248
248
assert . equal ( stdout , 'a{background:url(../partials/extra/down.gif) 0 0 no-repeat}' ) ;
249
249
}
250
250
} ) ,
251
- 'output' : binaryContext ( '-o ./base1-min.css ./test/fixtures/partials-relative/base.css' , {
251
+ 'output' : binaryContext ( '--with-rebase - o ./base1-min.css ./test/fixtures/partials-relative/base.css' , {
252
252
'should rewrite path relative to current path' : function ( ) {
253
253
var minimized = fs . readFileSync ( './base1-min.css' , 'utf-8' ) ;
254
254
assert . equal ( minimized , 'a{background:url(test/fixtures/partials/extra/down.gif) 0 0 no-repeat}' ) ;
@@ -301,13 +301,27 @@ vows.describe('cleancss')
301
301
. addBatch ( {
302
302
'complex import and skipped url rebasing' : {
303
303
'absolute' : binaryContext ( './test/fixtures/rebasing/assets/ui.css' , {
304
- 'should rebase urls correctly ' : function ( error , stdout ) {
304
+ 'should not rebase urls' : function ( error , stdout ) {
305
305
assert . isNull ( error ) ;
306
306
assert . include ( stdout , 'url(../images/glyphs.gif)' ) ;
307
307
assert . include ( stdout , 'url(../images/prev.gif)' ) ;
308
308
assert . include ( stdout , 'url(../images/next.gif)' ) ;
309
309
}
310
310
} )
311
+ } ,
312
+ 'complex import, skipped url rebasing, and output file' : {
313
+ 'absolute' : binaryContext ( '-o ./test/ui-no-rebase.min.css ./test/fixtures/rebasing/assets/ui.css' , {
314
+ 'should not rebase urls' : function ( ) {
315
+ var minimized = fs . readFileSync ( './test/ui-no-rebase.min.css' , 'utf-8' ) ;
316
+
317
+ assert . include ( minimized , 'url(../images/glyphs.gif)' ) ;
318
+ assert . include ( minimized , 'url(../images/prev.gif)' ) ;
319
+ assert . include ( minimized , 'url(../images/next.gif)' ) ;
320
+ } ,
321
+ teardown : function ( ) {
322
+ deleteFile ( 'test/ui-no-rebase.min.css' ) ;
323
+ }
324
+ } )
311
325
}
312
326
} )
313
327
. addBatch ( {
@@ -545,7 +559,27 @@ vows.describe('cleancss')
545
559
}
546
560
} )
547
561
. addBatch ( {
548
- 'source maps - output file with existing map' : binaryContext ( '--source-map -o ./styles.min.css ./test/fixtures/source-maps/styles.css' , {
562
+ 'source maps - output file with existing map and no rebasing' : binaryContext ( '--source-map -o ./styles.min.css ./test/fixtures/source-maps/styles.css' , {
563
+ 'includes right content in map file' : function ( ) {
564
+ var sourceMap = new SourceMapConsumer ( fs . readFileSync ( './styles.min.css.map' , 'utf-8' ) ) ;
565
+ assert . deepEqual (
566
+ sourceMap . originalPositionFor ( { line : 1 , column : 1 } ) ,
567
+ {
568
+ source : 'test/fixtures/source-maps/styles.css' ,
569
+ line : 1 ,
570
+ column : 0 ,
571
+ name : null
572
+ }
573
+ ) ;
574
+ } ,
575
+ 'teardown' : function ( ) {
576
+ deleteFile ( 'styles.min.css' ) ;
577
+ deleteFile ( 'styles.min.css.map' ) ;
578
+ }
579
+ } )
580
+ } )
581
+ . addBatch ( {
582
+ 'source maps - output file with existing map' : binaryContext ( '--source-map --with-rebase -o ./styles.min.css ./test/fixtures/source-maps/styles.css' , {
549
583
'includes right content in map file' : function ( ) {
550
584
var sourceMap = new SourceMapConsumer ( fs . readFileSync ( './styles.min.css.map' , 'utf-8' ) ) ;
551
585
assert . deepEqual (
@@ -565,7 +599,7 @@ vows.describe('cleancss')
565
599
} )
566
600
} )
567
601
. addBatch ( {
568
- 'source maps - output file for existing map in different folder' : binaryContext ( '--source-map -o ./styles-relative.min.css ./test/fixtures/source-maps/relative.css' , {
602
+ 'source maps - output file for existing map in different folder' : binaryContext ( '--source-map --with-rebase - o ./styles-relative.min.css ./test/fixtures/source-maps/relative.css' , {
569
603
'includes right content in map file' : function ( ) {
570
604
var sourceMap = new SourceMapConsumer ( fs . readFileSync ( './styles-relative.min.css.map' , 'utf-8' ) ) ;
571
605
assert . deepEqual (
0 commit comments