summaryrefslogtreecommitdiffstats
path: root/test/plugins
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-09-15 13:36:02 +0200
committerSamy Pessé <samypesse@gmail.com>2015-09-15 13:36:02 +0200
commite1930046599d430a6bb378af62bce78fb9d24ff7 (patch)
tree8e3abd0c5fc3aee6ba81403cb8b1e4b7b0918006 /test/plugins
parentfe3a9c33d0395ea9747ab8ef2fec24e81fc92715 (diff)
downloadgitbook-e1930046599d430a6bb378af62bce78fb9d24ff7.zip
gitbook-e1930046599d430a6bb378af62bce78fb9d24ff7.tar.gz
gitbook-e1930046599d430a6bb378af62bce78fb9d24ff7.tar.bz2
Fix passing context to block functions
Add test for it
Diffstat (limited to 'test/plugins')
-rw-r--r--test/plugins/blocks/index.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/plugins/blocks/index.js b/test/plugins/blocks/index.js
index 0848238..9bdbe86 100644
--- a/test/plugins/blocks/index.js
+++ b/test/plugins/blocks/index.js
@@ -39,18 +39,23 @@ module.exports = {
},
"test5args": {
process: function(blk) {
- return "test5"+blk.args.join(',')+"test5";
+ return "test5"+blk.args.join(",")+"test5";
}
},
"test5kwargs": {
process: function(blk) {
- var s = blk.args.join(',');
+ var s = blk.args.join(",");
for (var key in blk.kwargs) {
- s = s + ','+key+':'+blk.kwargs[key];
+ s = s + ","+key+":"+blk.kwargs[key];
}
return "test5"+s+"test5";
}
},
+ "test6context": {
+ process: function() {
+ return "test6"+(this.ctx.name)+"test6";
+ }
+ },
}
}; \ No newline at end of file