/** @overview nodeunit test case. */

var testResource = require('../../../test_resource'),
    mockReq = testResource.requireMockModule('mock_modules/mock_req'),
    mockRes = testResource.requireMockModule('mock_modules/mock_res'),
    mockContext = testResource.requireMockModule('mock_modules/mock_context'),
    definePublicFilesMiddleware = require('../../../../serverside/middleware/define_public_files_middleware.js');

exports.setUp = function (done) {
    done();
};

exports.tearDown = function (done) {
    done();
};


exports['Define public files middleware.'] = function (test) {
    var req = mockReq({}),
        res = mockRes({});
    var middleware = definePublicFilesMiddleware(mockContext({
        PUBLIC_DIR_PATH: testResource.resolveMockFile('.')
    }));
    middleware(req, res, function () {
        test.equal(res.setHeader('Content-type', 'test/html'));
        test.done();
    });
};