summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-asciidoc/test/page.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-21 10:18:15 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 11:46:14 +0100
commita81a503ff0bbbf66f6fefb7090f8516071ae817a (patch)
tree5a255d8453a3c4705083c6a6a4eba2f76fee7acf /packages/gitbook-asciidoc/test/page.js
parent11893255d1167382b16871d2ca831c90a40af57d (diff)
downloadgitbook-a81a503ff0bbbf66f6fefb7090f8516071ae817a.zip
gitbook-a81a503ff0bbbf66f6fefb7090f8516071ae817a.tar.gz
gitbook-a81a503ff0bbbf66f6fefb7090f8516071ae817a.tar.bz2
Add base to parse asciidoc
Diffstat (limited to 'packages/gitbook-asciidoc/test/page.js')
-rwxr-xr-xpackages/gitbook-asciidoc/test/page.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/packages/gitbook-asciidoc/test/page.js b/packages/gitbook-asciidoc/test/page.js
new file mode 100755
index 0000000..9579725
--- /dev/null
+++ b/packages/gitbook-asciidoc/test/page.js
@@ -0,0 +1,22 @@
+var fs = require('fs');
+var path = require('path');
+var assert = require('assert');
+
+var page = require('../').page;
+
+function loadPage (name, options) {
+ var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/' + name + '.adoc'), 'utf8');
+ return page(CONTENT, options).sections;
+}
+
+var LEXED = loadPage('PAGE');
+
+describe('Page parsing', function() {
+ it('should detect sections', function() {
+ assert.equal(LEXED.length, 1);
+ });
+
+ it('should gen content for normal sections', function() {
+ assert(LEXED[0].content);
+ });
+});