Skip to content

Commit

Permalink
Adding a test for processName option
Browse files Browse the repository at this point in the history
  • Loading branch information
pdokas committed Feb 21, 2013
1 parent 10a57f6 commit 8535ecb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Gruntfile.js
Expand Up @@ -121,6 +121,16 @@ module.exports = function(grunt) {
files: {
'tmp/custom_separator.js': ['test/fixtures/basic.hbs']
}
},
processname: {
options: {
processName: function(filename) {
return filename.toUpperCase();
}
},
files: {
'tmp/processname.js': ['test/fixtures/basic.hbs']
}
}
},
// Unit tests.
Expand Down
10 changes: 10 additions & 0 deletions test/expected/processname.js
@@ -0,0 +1,10 @@
this["JST"] = this["JST"] || {};

this["JST"]["TEST/FIXTURES/BASIC.HBS"] = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [2,'>= 1.0.0-rc.3'];
helpers = helpers || Handlebars.helpers; data = data || {};



return "Basic template that does nothing.";
});
10 changes: 10 additions & 0 deletions test/handlebars_test.js
Expand Up @@ -109,6 +109,16 @@ exports.handlebars = {
var expected = grunt.file.read('test/expected/custom_separator.js');
test.equal(actual, expected, 'should use custom file separators as specified.');

test.done();
},
processname: function(test) {
'use strict';
test.expect(1);

var actual = grunt.file.read('tmp/processname.js');
var expected = grunt.file.read('test/expected/processname.js');
test.equal(actual, expected, 'should convert template name to upper case.');

test.done();
}
};

0 comments on commit 8535ecb

Please sign in to comment.