diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-30 22:06:16 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-30 22:06:16 +0200 |
commit | c1d53ec11fbe085932df911bda5686b7bf671f53 (patch) | |
tree | 97ae6db641eb79ec9b061af136a0b2e3c549db55 /test/conrefs.js | |
parent | 36b49c66c6b75515bc84dd678fd52121a313e8d2 (diff) | |
download | gitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.zip gitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.tar.gz gitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.tar.bz2 |
Switch parsers to a model
Diffstat (limited to 'test/conrefs.js')
-rw-r--r-- | test/conrefs.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/test/conrefs.js b/test/conrefs.js deleted file mode 100644 index 6500709..0000000 --- a/test/conrefs.js +++ /dev/null @@ -1,49 +0,0 @@ -var mock = require('./mock'); -var ConrefsLoader = require('../lib/output/conrefs')(); - - -describe('Conrefs Loader', function() { - var output; - - before(function() { - return mock.outputDefaultBook(ConrefsLoader, { - 'test.md': 'World' - }) - .then(function(_output) { - output = _output; - }); - }); - - - it('should include a local file', function() { - return output.template.renderString('Hello {% include "./test.md" %}') - .should.be.fulfilledWith('Hello World'); - }); - - it('should include a git url', function() { - return output.template.renderString('Hello {% include "./test.md" %}') - .should.be.fulfilledWith('Hello World'); - }); - - it('should reject file out of scope', function() { - return output.template.renderString('Hello {% include "../test.md" %}') - .should.be.rejected(); - }); - - describe('Git Urls', function() { - it('should include a file from a git repo', function() { - return output.template.renderString('{% include "git+https://gist.github.com/69ea4542e4c8967d2fa7.git/test.md" %}') - .should.be.fulfilledWith('Hello from git'); - }); - - it('should handle deep inclusion (1)', function() { - return output.template.renderString('{% include "git+https://gist.github.com/69ea4542e4c8967d2fa7.git/test2.md" %}') - .should.be.fulfilledWith('First Hello. Hello from git'); - }); - - it('should handle deep inclusion (2)', function() { - return output.template.renderString('{% include "git+https://gist.github.com/69ea4542e4c8967d2fa7.git/test3.md" %}') - .should.be.fulfilledWith('First Hello. Hello from git'); - }); - }); -}); |