var fs = require('fs'),
    mockFs = require('mock-fs'),
    Config = require('../../../lib/config'),
    Model = require('../../../lib/model/model'),
    MakePagesCache = require('../../../lib/tasks/make-pages-cache');

describe('MakePagesCache', function () {
    beforeEach(function () {
        mockFs({
            cache: {}
        });
    });

    afterEach(function () {
        mockFs.restore();
    });

    describe('instance methods', function () {
        var config,
            model,
            task;

        before(function () {
            config = new Config('debug'),
                task = new MakePagesCache(config, {}),
                model = new Model();

            config.setCacheFolder('./cache');
            model.setPages([
                {
                    url: '/foo1/bar1',
                    en: {}
                },
                {
                    url: '/foo2/bar2',
                    en: {}
                }
            ]);
        });

        describe('run', function () {
            it('should successfully create cache sub-folders', function (done) {
                task.run(model)
                    .then(function () {
                        fs.existsSync('./cache/foo1/bar1').should.equal(true);
                        fs.existsSync('./cache/foo2/bar2').should.equal(true);
                        done();
                    });

            });

            //it('should fail if data folder does not exists', function (done) {
            //    fs.rmdirSync('./data');
            //    task.run(model).catch(function (error) {
            //        error.code.should.equal('ENOENT');
            //        done();
            //    });
            //});
        });
    });
});

@@ -977,32 +977,733 @@
 );%0A        %7D);%0A%0A
+        describe('_makeFolder', function () %7B%0A            it('should successfully create cache folder for page', function (done) %7B%0A                task._makeFolder(%7B url: '/foo' %7D).then(function () %7B%0A                    fs.existsSync('./cache/foo').should.equal(true);%0A                    done();%0A                %7D);%0A            %7D);%0A%0A            it('should reject on empty page.url', function (done) %7B%0A                task._makeFolder(%7B%7D).catch(function (error) %7B%0A                    error.message.should.equal('Arguments to path.join must be strings');%0A                    fs.existsSync('./cache/foo').should.equal(false);%0A                    done();%0A                %7D);%0A            %7D);%0A        %7D);%0A%0A
         describe
@@ -1716,32 +1716,32 @@
 , function () %7B%0A
-
             it('
@@ -2083,33 +2083,32 @@
             %7D);%0A
-%0A
             %7D);%0A
@@ -2110,318 +2110,8 @@
  %7D);
-%0A%0A            //it('should fail if data folder does not exists', function (done) %7B%0A            //    fs.rmdirSync('./data');%0A            //    task.run(model).catch(function (error) %7B%0A            //        error.code.should.equal('ENOENT');%0A            //        done();%0A            //    %7D);%0A            //%7D);
 %0A   

Add tests for make-pages-cache task module