summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-27 21:39:41 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-27 21:39:41 +0100
commitcf12d090928907bb82c9f1796b642cbef9b42640 (patch)
treeb229ff036508d52cbc8c9b50614c99f8ee8d0c65 /test
parent8e18adbe4cd64b8d6baf63627cba4109774fc7e5 (diff)
downloadgitbook-cf12d090928907bb82c9f1796b642cbef9b42640.zip
gitbook-cf12d090928907bb82c9f1796b642cbef9b42640.tar.gz
gitbook-cf12d090928907bb82c9f1796b642cbef9b42640.tar.bz2
Complete parsing of blocks from plugin extensions
Diffstat (limited to 'test')
-rw-r--r--test/plugins.js4
-rw-r--r--test/plugins/blocks/index.js12
2 files changed, 8 insertions, 8 deletions
diff --git a/test/plugins.js b/test/plugins.js
index 560a779..0f826d2 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -110,9 +110,9 @@ describe('Plugins', function () {
it('should correctly extend template blocks with sub-blocks', function(done) {
qdone(
- books[0].template.renderString('{% test3join %}hello{% also %}the{% also %}world{% endtest3join %}')
+ books[0].template.renderString('{% test3join separator=";" %}hello{% also %}world{% endtest3join %}')
.then(function(content) {
- assert.equal(content, "hello the world");
+ assert.equal(content, "hello;world");
}),
done
);
diff --git a/test/plugins/blocks/index.js b/test/plugins/blocks/index.js
index 0f5fb87..f2c588a 100644
--- a/test/plugins/blocks/index.js
+++ b/test/plugins/blocks/index.js
@@ -1,22 +1,22 @@
module.exports = {
blocks: {
"test": {
- process: function(args) {
- return "test"+args.body+"test";
+ process: function(blk) {
+ return "test"+blk.body+"test";
}
},
"test2": {
end: "endtest2end",
- process: function(args) {
- return "test2"+args.body+"test2";
+ process: function(blk) {
+ return "test2"+blk.body+"test2";
}
},
"test3join": {
blocks: [
"also"
],
- process: function(args) {
- return "test";
+ process: function(blk) {
+ return [blk.body, blk.blocks[0].body].join(blk.kwargs.separator);
}
}
}