summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-markdown/test/langs.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-19 11:20:23 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 15:00:29 +0100
commitd6a9cc1417a35d6315366ee5b2da993ffc64f06c (patch)
tree93ec5473b9812d2012f93c96a6962fa821270169 /packages/gitbook-markdown/test/langs.js
parent283ebb9e8e27159406b86cbfbfe6eea0a4b3042f (diff)
downloadgitbook-d6a9cc1417a35d6315366ee5b2da993ffc64f06c.zip
gitbook-d6a9cc1417a35d6315366ee5b2da993ffc64f06c.tar.gz
gitbook-d6a9cc1417a35d6315366ee5b2da993ffc64f06c.tar.bz2
Add parsing of langs and associated tests
Diffstat (limited to 'packages/gitbook-markdown/test/langs.js')
-rw-r--r--packages/gitbook-markdown/test/langs.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/gitbook-markdown/test/langs.js b/packages/gitbook-markdown/test/langs.js
new file mode 100644
index 0000000..3a1f082
--- /dev/null
+++ b/packages/gitbook-markdown/test/langs.js
@@ -0,0 +1,18 @@
+var fs = require('fs');
+var path = require('path');
+var assert = require('assert');
+
+var langs = require('../').langs;
+
+var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/LANGS.md'), 'utf8');
+var LEXED = langs(CONTENT);
+
+describe('Languages parsing', function () {
+ it('should detect paths and titles', function() {
+ assert.equal(LEXED.list[0].path,'en');
+ assert.equal(LEXED.list[0].title,'English');
+
+ assert.equal(LEXED.list[1].path,'fr');
+ assert.equal(LEXED.list[1].title,'French');
+ });
+});