From 1141d34f07ca4a9937dd4f43b43e5faa01da832c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Mon, 15 Feb 2016 14:19:30 +0100 Subject: Add tests for args in blocks --- test/template.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/template.js b/test/template.js index d12a641..a76fe93 100644 --- a/test/template.js +++ b/test/template.js @@ -34,6 +34,15 @@ describe('Template', function() { .should.be.fulfilledWith('Hello World!'); }); + it('should correctly add a block with args', function() { + output.template.addBlock('sayhello_args', function(blk) { + return 'Hello ' + blk.args[0] + '!'; + }); + + return output.template.renderString('{% sayhello_args "World" %}{% endsayhello_args %}') + .should.be.fulfilledWith('Hello World!'); + }); + it('should correctly add a block with kwargs', function() { output.template.addBlock('sayhello_kwargs', function(blk) { return 'Hello ' + blk.kwargs.name + '!'; -- cgit v1.1