summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-24 11:57:21 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-24 11:57:21 +0100
commitfd98746c2b14985b914678f39361b31028437d5b (patch)
treee7e87f00b404490b54ca9be9f749598653bb1853 /test
parent2efd234824c8ec0a87bd20f807867b16cf169ecc (diff)
downloadgitbook-fd98746c2b14985b914678f39361b31028437d5b.zip
gitbook-fd98746c2b14985b914678f39361b31028437d5b.tar.gz
gitbook-fd98746c2b14985b914678f39361b31028437d5b.tar.bz2
Update gitbook-parsers and improve summary tests
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/test1/SUMMARY.md2
-rw-r--r--test/parsing.js12
2 files changed, 13 insertions, 1 deletions
diff --git a/test/fixtures/test1/SUMMARY.md b/test/fixtures/test1/SUMMARY.md
index 4a87f8c..d05fc4a 100644
--- a/test/fixtures/test1/SUMMARY.md
+++ b/test/fixtures/test1/SUMMARY.md
@@ -3,4 +3,4 @@
* [Chapter 1](test.md)
* [Article 1](sub/test1.md)
* [Chapter 2](test2.md)
-
+* [Google](https://www.google.com)
diff --git a/test/parsing.js b/test/parsing.js
index 5f40594..0166e85 100644
--- a/test/parsing.js
+++ b/test/parsing.js
@@ -17,8 +17,20 @@ describe('Book parsing', function () {
var LEXED = books[1].summary;
assert.equal(LEXED.chapters[0].path, 'intro.md');
+ assert.equal(LEXED.chapters[0].exists, true);
+ assert.equal(LEXED.chapters[0].external, false);
+
assert.equal(LEXED.chapters[1].path, 'test.md');
+ assert.equal(LEXED.chapters[1].exists, false);
+ assert.equal(LEXED.chapters[1].external, false);
+
assert.equal(LEXED.chapters[2].path, 'test2.md');
+ assert.equal(LEXED.chapters[2].exists, false);
+ assert.equal(LEXED.chapters[2].external, false);
+
+ assert.equal(LEXED.chapters[3].path, 'https://www.google.com');
+ assert.equal(LEXED.chapters[3].exists, true);
+ assert.equal(LEXED.chapters[3].external, true);
});
it('should correctly parse the glossary', function() {