var fs = require('fs'),
    path = require('path'),
    testResource = require('../../../test_resource'),
    filterDirectory = require('../../../../lib/file/filter_directory');

exports['Filter directory.'] = function (test) {
    var dirname = testResource.resolveMockFile('.');
    fs.readdir(dirname, function (err, filenames) {
        filterDirectory(filenames.map(function (filename) {
            return path.resolve(dirname, filename);
        }), function (err, dirnames) {
            test.ifError(err);
            test.ok(dirnames);
            test.done();
        });
    });
};