summaryrefslogtreecommitdiffstats
path: root/test/parsing.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 16:00:12 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-19 16:00:12 +0100
commit5ed584449007d9c6c816e765ce3e999e14abbf97 (patch)
treef8db5ec4357bd93a541412748997056dc83165bc /test/parsing.js
parent777963c97c41094555b1ea94b351adf380637922 (diff)
downloadgitbook-5ed584449007d9c6c816e765ce3e999e14abbf97.zip
gitbook-5ed584449007d9c6c816e765ce3e999e14abbf97.tar.gz
gitbook-5ed584449007d9c6c816e765ce3e999e14abbf97.tar.bz2
Parse list of files and add test for it
Diffstat (limited to 'test/parsing.js')
-rw-r--r--test/parsing.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parsing.js b/test/parsing.js
index db14d13..2c63a02 100644
--- a/test/parsing.js
+++ b/test/parsing.js
@@ -1,4 +1,5 @@
var path = require('path');
+var _ = require('lodash');
var assert = require('assert');
var Book = require('../').Book;
@@ -29,6 +30,13 @@ describe('Book parsing', function () {
assert.equal(LEXED[1].description, "a second test");
});
+ it('should correctly parse files', function() {
+ var FILES = book1.files;
+
+ assert.equal(FILES.length, 4);
+ assert.equal(_.difference(FILES, [ 'GLOSSARY.md', 'README.md', 'SUMMARY.md', 'intro.md' ]).length, 0);
+ });
+
it('should correctly parse the languages', function() {
assert.equal(book2.books.length, 2);
assert(book2.isMultilingual());