Skip to content
Browse files

Adding a test for processName option

  • Loading branch information...
1 parent 10a57f6 commit 8535ecbe82036dc5aceec52f586288794005b5b1 @pdokas pdokas committed Feb 20, 2013
Showing with 30 additions and 0 deletions.
  1. +10 −0 Gruntfile.js
  2. +10 −0 test/expected/processname.js
  3. +10 −0 test/handlebars_test.js
View
10 Gruntfile.js
@@ -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.
View
10 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.";
+ });
View
10 test/handlebars_test.js
@@ -110,5 +110,15 @@ exports.handlebars = {
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.
Something went wrong with that request. Please try again.