var testResource = require('../../../test_resource'),
    loadHbsTmpl = require('../../../../lib/file/load_hbs_tmpl');

exports['Load a handlebars template'] = function (test) {
    var filename = testResource.resolveMockFile('mock-template.hbs');
    loadHbsTmpl(filename, function (err, tmpl) {
        test.ifError(err);
        var rendered = tmpl({body: 'foo!'});
        test.ok((rendered).match(/foo/));
        test.done();
    });
};
exports['Failed to load.'] = function (test) {
    loadHbsTmpl('/foo/bar/__not_exists', function (err) {
        test.ok(err);
        test.done();
    });
};