Skip to content

Commit bfcdc65

Browse files
committed
tests/all-rules.js: minor refactoring.
1 parent 94c6db9 commit bfcdc65

File tree

1 file changed

+31
-33
lines changed

1 file changed

+31
-33
lines changed

tests/all-rules.js

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
* to fail due to Java stack overflow. This must be run separate from other tests.
99
*/
1010

11-
/* jshint loopfunc:true */
12-
1311
(function(){
1412
"use strict";
1513
var Assert = YUITest.Assert,
@@ -18,48 +16,48 @@
1816
len = rules.length,
1917
i;
2018

21-
for (i=0; i < len; i++){
22-
23-
(function(i, rules){
19+
function testAll(i, rules){
2420

25-
suite.add(new YUITest.TestCase({
21+
suite.add(new YUITest.TestCase({
2622

27-
name: "General Tests for " + rules[i].id,
23+
name: "General Tests for " + rules[i].id,
2824

29-
setUp: function(){
30-
this.options = {};
31-
this.options[rules[i].id] = 1;
32-
},
25+
setUp: function(){
26+
this.options = {};
27+
this.options[rules[i].id] = 1;
28+
},
3329

34-
"Using @viewport should not result in an error": function(){
35-
var result = CSSLint.verify("@viewport { width: auto; }", this.options);
36-
Assert.areEqual(0, result.messages.length);
37-
},
30+
"Using @viewport should not result in an error": function(){
31+
var result = CSSLint.verify("@viewport { width: auto; }", this.options);
32+
Assert.areEqual(0, result.messages.length);
33+
},
3834

39-
"Using @keyframes should not result in an error": function(){
40-
var result = CSSLint.verify("@keyframes resize { 0% {padding: 0;} 50% {padding: 0;} 100% {padding: 0;}}", this.options);
41-
Assert.areEqual(0, result.messages.length);
42-
},
35+
"Using @keyframes should not result in an error": function(){
36+
var result = CSSLint.verify("@keyframes resize { 0% {padding: 0;} 50% {padding: 0;} 100% {padding: 0;}}", this.options);
37+
Assert.areEqual(0, result.messages.length);
38+
},
4339

44-
"Using @page should not result in an error": function(){
45-
var result = CSSLint.verify("@page { width: 100px; }", this.options);
46-
Assert.areEqual(0, result.messages.length);
47-
},
40+
"Using @page should not result in an error": function(){
41+
var result = CSSLint.verify("@page { width: 100px; }", this.options);
42+
Assert.areEqual(0, result.messages.length);
43+
},
4844

49-
"Using @page @top-left should not result in an error": function(){
50-
var result = CSSLint.verify("@page { @top-left { content: ''; } }", this.options);
51-
Assert.areEqual(0, result.messages.length);
52-
},
45+
"Using @page @top-left should not result in an error": function(){
46+
var result = CSSLint.verify("@page { @top-left { content: ''; } }", this.options);
47+
Assert.areEqual(0, result.messages.length);
48+
},
5349

54-
"Using a regular rule should not result in an error": function(){
55-
var result = CSSLint.verify("body { margin: 0; }", this.options);
56-
Assert.areEqual(0, result.messages.length);
57-
}
50+
"Using a regular rule should not result in an error": function(){
51+
var result = CSSLint.verify("body { margin: 0; }", this.options);
52+
Assert.areEqual(0, result.messages.length);
53+
}
5854

59-
}));
55+
}));
6056

61-
})(i, rules);
57+
}
6258

59+
for (i = 0; i < len; i++){
60+
testAll(i, rules);
6361
}
6462

6563
YUITest.TestRunner.add(suite);

0 commit comments

Comments
 (0)