'use strict';

var expect = require('chai').expect,
    fs = require('fs'),
    path = require('path'),
    rulesDir = path.join(__dirname, '../lib/rules/'),
    plugin = require('..');

describe('eslint-plugin-mocha', function () {
    var ruleFiles;

    before(function (done) {
        fs.readdir(rulesDir, function (error, files) {
            ruleFiles = files;
            done(error);
        });
    });

    it('should expose all rules', function () {
        ruleFiles.forEach(function (file) {
            var ruleName = path.basename(file, '.js');

            expect(plugin).to.have.deep.property('rules.' + ruleName)
                .that.equals(require(rulesDir + ruleName));
        });
    });
});

@@ -147,24 +147,87 @@
 b/rules/'),%0A
+    documentationDir = path.join(__dirname, '../docs/rules/'),%0A
     plugin =
@@ -767,13 +767,654 @@
 %0A    %7D);
+%0A%0A    describe('documentation', function () %7B%0A        var documentationFiles;%0A%0A        before(function (done) %7B%0A            fs.readdir(documentationDir, function (error, files) %7B%0A                documentationFiles = files;%0A                done(error);%0A            %7D);%0A        %7D);%0A%0A        it('should have each rule documented', function () %7B%0A            ruleFiles.forEach(function (file) %7B%0A                var ruleName = path.basename(file, '.js'),%0A                    expectedDocumentationFileName = ruleName + '.md';%0A%0A                expect(documentationFiles).to.contain(expectedDocumentationFileName);%0A            %7D);%0A        %7D);%0A    %7D);
 %0A%7D);%0A

Add test to ensure each rule is documented