73f91747c5610e627d47d3207cea30770f0c8549.svn-base
621 Bytes
var grunt = require('../../lib/grunt');
exports['template'] = {
'process': function(test) {
test.expect(4);
var obj = {
foo: 'c',
bar: 'b<%= foo %>d',
baz: 'a<%= bar %>e'
};
test.equal(grunt.template.process('<%= foo %>', obj), 'c', 'should retrieve value.');
test.equal(grunt.template.process('<%= bar %>', obj), 'bcd', 'should recurse.');
test.equal(grunt.template.process('<%= baz %>', obj), 'abcde', 'should recurse.');
obj.foo = '<% oops %';
test.equal(grunt.template.process('<%= baz %>', obj), 'ab<% oops %de', 'should not explode.');
test.done();
}
};