summaryrefslogtreecommitdiffstats
path: root/test/plugins.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-29 14:09:27 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-29 14:09:27 +0100
commit2bec7c5e10274b260faea3e007b056c19760cc6e (patch)
tree7c16616115430b151093e634afe3e66b8341ffe1 /test/plugins.js
parent907ce6dbcdbebd59f4ce5a43073b0dd68056d6c2 (diff)
downloadgitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.zip
gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.gz
gitbook-2bec7c5e10274b260faea3e007b056c19760cc6e.tar.bz2
Add option to block to not parse output
Diffstat (limited to 'test/plugins.js')
-rw-r--r--test/plugins.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/plugins.js b/test/plugins.js
index f72f719..2351537 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -107,6 +107,11 @@ describe('Plugins', function () {
var plugin = new Plugin(books[0], "blocks");
plugin.load("./blocks", PLUGINS_ROOT);
+ var testTpl = function(str, args, options) {
+ return books[0].template.renderString(str, args, options)
+ .then(books[0].template.postProcess)
+ };
+
before(function(done) {
qdone(books[0].plugins.load(plugin), done);
});
@@ -117,7 +122,7 @@ describe('Plugins', function () {
it('should correctly extend template blocks', function(done) {
qdone(
- books[0].template.renderString('{% test %}hello{% endtest %}')
+ testTpl('{% test %}hello{% endtest %}')
.then(function(content) {
assert.equal(content, "testhellotest");
}),
@@ -127,7 +132,7 @@ describe('Plugins', function () {
it('should correctly accept shortcuts', function(done) {
qdone(
- books[0].template.renderString('$$hello$$', {}, {
+ testTpl('$$hello$$', {}, {
type: "markdown"
})
.then(function(content) {
@@ -139,7 +144,7 @@ describe('Plugins', function () {
it('should correctly extend template blocks with defined end', function(done) {
qdone(
- books[0].template.renderString('{% test2 %}hello{% endtest2end %}')
+ testTpl('{% test2 %}hello{% endtest2end %}')
.then(function(content) {
assert.equal(content, "test2hellotest2");
}),
@@ -149,7 +154,7 @@ describe('Plugins', function () {
it('should correctly extend template blocks with sub-blocks', function(done) {
qdone(
- books[0].template.renderString('{% test3join separator=";" %}hello{% also %}world{% endtest3join %}')
+ testTpl('{% test3join separator=";" %}hello{% also %}world{% endtest3join %}')
.then(function(content) {
assert.equal(content, "hello;world");
}),
@@ -159,7 +164,7 @@ describe('Plugins', function () {
it('should correctly extend template blocks with different sub-blocks', function(done) {
qdone(
- books[0].template.renderString('{% test4join separator=";" %}hello{% also %}the{% finally %}world{% endtest4join %}')
+ testTpl('{% test4join separator=";" %}hello{% also %}the{% finally %}world{% endtest4join %}')
.then(function(content) {
assert.equal(content, "hello;the;world");
}),