summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 15:46:34 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 15:46:34 +0100
commit2ae392436536b4abd9f7edf195eb6b0c0a0985f1 (patch)
tree9673e6fd3ab161ef956e56b9e89f1b2207895182 /test
parentd172aaefee8eb733d23a4e92abd79cbc4a43f801 (diff)
downloadgitbook-2ae392436536b4abd9f7edf195eb6b0c0a0985f1.zip
gitbook-2ae392436536b4abd9f7edf195eb6b0c0a0985f1.tar.gz
gitbook-2ae392436536b4abd9f7edf195eb6b0c0a0985f1.tar.bz2
Fix parsing of langs
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/test2/LANGS.md4
-rw-r--r--test/fixtures/test2/README.md2
-rw-r--r--test/fixtures/test2/en/README.md1
-rw-r--r--test/fixtures/test2/en/SUMMARY.md1
-rw-r--r--test/fixtures/test2/fr/README.md1
-rw-r--r--test/fixtures/test2/fr/SUMMARY.md1
-rw-r--r--test/helper.js9
-rw-r--r--test/parsing.js4
8 files changed, 22 insertions, 1 deletions
diff --git a/test/fixtures/test2/LANGS.md b/test/fixtures/test2/LANGS.md
new file mode 100644
index 0000000..a501d22
--- /dev/null
+++ b/test/fixtures/test2/LANGS.md
@@ -0,0 +1,4 @@
+# Languages
+
+* [English](en/)
+* [French](fr/)
diff --git a/test/fixtures/test2/README.md b/test/fixtures/test2/README.md
new file mode 100644
index 0000000..c6186ac
--- /dev/null
+++ b/test/fixtures/test2/README.md
@@ -0,0 +1,2 @@
+# Multi-Languages test
+
diff --git a/test/fixtures/test2/en/README.md b/test/fixtures/test2/en/README.md
new file mode 100644
index 0000000..95bc71c
--- /dev/null
+++ b/test/fixtures/test2/en/README.md
@@ -0,0 +1 @@
+# English Book
diff --git a/test/fixtures/test2/en/SUMMARY.md b/test/fixtures/test2/en/SUMMARY.md
new file mode 100644
index 0000000..ac9323c
--- /dev/null
+++ b/test/fixtures/test2/en/SUMMARY.md
@@ -0,0 +1 @@
+# Summary
diff --git a/test/fixtures/test2/fr/README.md b/test/fixtures/test2/fr/README.md
new file mode 100644
index 0000000..c7a4103
--- /dev/null
+++ b/test/fixtures/test2/fr/README.md
@@ -0,0 +1 @@
+# French Book
diff --git a/test/fixtures/test2/fr/SUMMARY.md b/test/fixtures/test2/fr/SUMMARY.md
new file mode 100644
index 0000000..ac9323c
--- /dev/null
+++ b/test/fixtures/test2/fr/SUMMARY.md
@@ -0,0 +1 @@
+# Summary
diff --git a/test/helper.js b/test/helper.js
index f80edcb..f9723b9 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -14,6 +14,13 @@ global.qdone = function qdone(promise, done) {
// Init before doing tests
before(function(done) {
global.book1 = new Book(path.join(__dirname, './fixtures/test1'));
+ global.book2 = new Book(path.join(__dirname, './fixtures/test2'));
- qdone(global.book1.init(), done);
+ qdone(
+ global.book1.init()
+ .then(function() {
+ return global.book2.init();
+ }),
+ done
+ );
});
diff --git a/test/parsing.js b/test/parsing.js
index 1464ed2..b1c4114 100644
--- a/test/parsing.js
+++ b/test/parsing.js
@@ -28,4 +28,8 @@ describe('Book parsing', function () {
assert.equal(LEXED[1].name, "Test 2");
assert.equal(LEXED[1].description, "a second test");
});
+
+ it('should correctly parse the languages', function() {
+ assert.equal(book2.books.length, 2);
+ });
});