From 8356c534f5bc33da42bc27a6dd0cbca19983dc0c Mon Sep 17 00:00:00 2001 From: Samy Pesse Date: Thu, 18 Jun 2015 11:09:02 +0200 Subject: [PATCH] Add failing tests for block's arguments --- test/plugins.js | 7 +++++++ test/plugins/blocks/index.js | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/test/plugins.js b/test/plugins.js index 14f4a2ff3..02b7627ac 100644 --- a/test/plugins.js +++ b/test/plugins.js @@ -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"); + }); + }); }); }); diff --git a/test/plugins/blocks/index.js b/test/plugins/blocks/index.js index 32f1910fc..c69801ef4 100644 --- a/test/plugins/blocks/index.js +++ b/test/plugins/blocks/index.js @@ -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"; + } + }, } }; \ No newline at end of file