Add failing tests for block's arguments

This commit is contained in:
Samy Pesse
2015-06-18 11:09:02 +02:00
parent 78ff2687b4
commit 8356c534f5
2 changed files with 13 additions and 1 deletions
+7
View File
@@ -185,6 +185,13 @@ describe('Plugins', function () {
content.should.equal("hello;the;world");
});
});
it('should correctly extend template blocks with arguments', function() {
return testTpl('{% test5args "a", "b", "c" %}{% endtest5args %}')
.then(function(content) {
content.should.equal("test5a,b,ctest5");
});
});
});
});
+6 -1
View File
@@ -36,6 +36,11 @@ module.exports = {
assert(blk.blocks[1].name, "finally");
return [blk.body, blk.blocks[0].body, blk.blocks[1].body].join(blk.kwargs.separator);
}
}
},
"test5args": {
process: function(blk) {
return "test5"+blk.args.join(',')+"test5";
}
},
}
};