From: GoalSmashers Date: Mon, 4 Nov 2013 12:26:33 +0000 (+0100) Subject: Updates unit tests to allow flat arguments only in cssContext. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=6c4ba324a0fb28b9189fa2cd1244160ae410e669;p=clean-css.git Updates unit tests to allow flat arguments only in cssContext. * There is no ' #' appended to test name anymore. --- diff --git a/test/unit-test.js b/test/unit-test.js index f74652db..3608364b 100644 --- a/test/unit-test.js +++ b/test/unit-test.js @@ -20,15 +20,11 @@ var cssContext = function(groups, options) { var transformation = groups[g]; if (typeof transformation == 'string') transformation = [transformation, transformation]; - if (!transformation[0].push) - transformation = [[transformation[0], transformation[1]]]; - for (var i = 0, c = transformation.length; i < c; i++) { - context[g + ' #' + (i + 1)] = { - topic: transformation[i][0], - clean: clean(transformation[i][1]) - }; - } + context[g] = { + topic: transformation[0], + clean: clean(transformation[1]) + }; } return context; @@ -231,14 +227,13 @@ vows.describe('clean-units').addBatch({ 'div :first-child{display:block}', 'div :first-child{display:block}' ], - 'strip universal selector when coming with id/class/attribute selectors': [ - [ - '* > *#id > *.class{display:block}', - '*>#id>.class{display:block}' - ],[ - '*:first-child > *[data-id]{display:block}', - ':first-child>[data-id]{display:block}' - ] + 'strip universal selector from id and class selectors': [ + '* > *#id > *.class{display:block}', + '*>#id>.class{display:block}' + ], + 'strip universal selector from attribute selectors': [ + '*:first-child > *[data-id]{display:block}', + ':first-child>[data-id]{display:block}' ], 'not strip standalone universal selector': [ 'label ~ * + span{display:block}',