@@ -248,7 +248,7 @@ vows.describe('cleancss')
248248 assert . equal ( stdout , 'a{background:url(../partials/extra/down.gif) 0 0 no-repeat}' ) ;
249249 }
250250 } ) ,
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' , {
252252 'should rewrite path relative to current path' : function ( ) {
253253 var minimized = fs . readFileSync ( './base1-min.css' , 'utf-8' ) ;
254254 assert . equal ( minimized , 'a{background:url(test/fixtures/partials/extra/down.gif) 0 0 no-repeat}' ) ;
@@ -301,13 +301,27 @@ vows.describe('cleancss')
301301 . addBatch ( {
302302 'complex import and skipped url rebasing' : {
303303 'absolute' : binaryContext ( './test/fixtures/rebasing/assets/ui.css' , {
304- 'should rebase urls correctly ' : function ( error , stdout ) {
304+ 'should not rebase urls' : function ( error , stdout ) {
305305 assert . isNull ( error ) ;
306306 assert . include ( stdout , 'url(../images/glyphs.gif)' ) ;
307307 assert . include ( stdout , 'url(../images/prev.gif)' ) ;
308308 assert . include ( stdout , 'url(../images/next.gif)' ) ;
309309 }
310310 } )
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+ } )
311325 }
312326 } )
313327 . addBatch ( {
@@ -545,7 +559,27 @@ vows.describe('cleancss')
545559 }
546560 } )
547561 . 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' , {
549583 'includes right content in map file' : function ( ) {
550584 var sourceMap = new SourceMapConsumer ( fs . readFileSync ( './styles.min.css.map' , 'utf-8' ) ) ;
551585 assert . deepEqual (
@@ -565,7 +599,7 @@ vows.describe('cleancss')
565599 } )
566600 } )
567601 . 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' , {
569603 'includes right content in map file' : function ( ) {
570604 var sourceMap = new SourceMapConsumer ( fs . readFileSync ( './styles-relative.min.css.map' , 'utf-8' ) ) ;
571605 assert . deepEqual (
0 commit comments