diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:39:36 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-22 15:39:36 +0100 |
commit | 0b3bdcb2193e10f5bf0f6959475563d8c430aa40 (patch) | |
tree | 78de15e61b8beaadaefd5f0c48159c5fa4680311 /test/node_modules/gitbook-plugin-test-blocks/index.js | |
parent | 6653307fda137253cd10d4d4f6d2e010c1c0f604 (diff) | |
download | gitbook-0b3bdcb2193e10f5bf0f6959475563d8c430aa40.zip gitbook-0b3bdcb2193e10f5bf0f6959475563d8c430aa40.tar.gz gitbook-0b3bdcb2193e10f5bf0f6959475563d8c430aa40.tar.bz2 |
Add tests for blocks from plugins
Diffstat (limited to 'test/node_modules/gitbook-plugin-test-blocks/index.js')
-rw-r--r-- | test/node_modules/gitbook-plugin-test-blocks/index.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/node_modules/gitbook-plugin-test-blocks/index.js b/test/node_modules/gitbook-plugin-test-blocks/index.js new file mode 100644 index 0000000..7104006 --- /dev/null +++ b/test/node_modules/gitbook-plugin-test-blocks/index.js @@ -0,0 +1,21 @@ +var should = require('should'); + +module.exports = { + blocks: { + // Simple test + hello: function(blk) { + return 'Hello ' + blk.body + '!'; + }, + + // Test using the conetxt "this" + testContext: function(s) { + this.should.have.property('config'); + this.should.have.property('log'); + this.should.have.property('options'); + this.should.have.property('resolve').which.is.a.function; + this.should.have.property('book').which.equal(this); + + return 'Hello ' + s + '!'; + } + } +}; |