Handle mixed case for config keys.

This commit is contained in:
David Anson 2015-09-21 23:21:17 -07:00
parent c98660c492
commit 071bba88fc
2 changed files with 77 additions and 9 deletions

View file

@ -349,6 +349,35 @@ module.exports.enableRules = function enableRules(test) {
});
};
module.exports.enableRulesMixedCase = function enableRulesMixedCase(test) {
test.expect(2);
var options = {
"files": [
"./test/atx_header_spacing.md",
"./test/first_header_bad_atx.md"
],
"config": {
"Md002": true,
"DeFaUlT": false,
"Md019": true
}
};
markdownlint(options, function callback(err, actualResult) {
test.ifError(err);
var expectedResult = {
"./test/atx_header_spacing.md": {
"MD002": [ 3 ],
"MD019": [ 3, 5 ]
},
"./test/first_header_bad_atx.md": {
"MD002": [ 1 ]
}
};
test.deepEqual(actualResult, expectedResult, "Undetected issues.");
test.done();
});
};
module.exports.disableTag = function disableTag(test) {
test.expect(2);
var options = {
@ -404,6 +433,32 @@ module.exports.enableTag = function enableTag(test) {
});
};
module.exports.enableTagMixedCase = function enableTagMixedCase(test) {
test.expect(2);
var options = {
"files": [
"./test/atx_header_spacing.md",
"./test/first_header_bad_atx.md"
],
"config": {
"DeFaUlT": false,
"SpAcEs": true
}
};
markdownlint(options, function callback(err, actualResult) {
test.ifError(err);
var expectedResult = {
"./test/atx_header_spacing.md": {
"MD018": [ 1 ],
"MD019": [ 3, 5 ]
},
"./test/first_header_bad_atx.md": {}
};
test.deepEqual(actualResult, expectedResult, "Undetected issues.");
test.done();
});
};
module.exports.styleFiles = function styleFiles(test) {
test.expect(4);
fs.readdir("./style", function readdir(err, files) {
@ -634,6 +689,14 @@ module.exports.missingStringValue = function missingStringValue(test) {
});
};
module.exports.ruleNamesUpperCase = function ruleNamesUpperCase(test) {
test.expect(37);
rules.forEach(function forRule(rule) {
test.equal(rule.name, rule.name.toUpperCase(), "Rule name not upper-case.");
});
test.done();
};
module.exports.readme = function readme(test) {
test.expect(97);
var tagToRules = {};