summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-html/test/readme.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-19 13:14:52 +0100
committerSamy Pessé <samypesse@gmail.com>2016-12-22 12:32:13 +0100
commit9e99b5850fd866fc2f9196993a0ae7e342311558 (patch)
treee430d039378e159f9046095e6f35285ecf6497fe /packages/gitbook-html/test/readme.js
parenteb0bf31baa6cb903ba4242ae5a3866ff67aeb97c (diff)
downloadgitbook-9e99b5850fd866fc2f9196993a0ae7e342311558.zip
gitbook-9e99b5850fd866fc2f9196993a0ae7e342311558.tar.gz
gitbook-9e99b5850fd866fc2f9196993a0ae7e342311558.tar.bz2
Base code
Diffstat (limited to 'packages/gitbook-html/test/readme.js')
-rwxr-xr-xpackages/gitbook-html/test/readme.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/gitbook-html/test/readme.js b/packages/gitbook-html/test/readme.js
new file mode 100755
index 0000000..9d9ca29
--- /dev/null
+++ b/packages/gitbook-html/test/readme.js
@@ -0,0 +1,28 @@
+var fs = require('fs');
+var path = require('path');
+var assert = require('assert');
+
+var readme = require('../').readme;
+
+
+var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.html'), 'utf8');
+var LEXED = readme(CONTENT);
+
+describe('Readme parsing', function () {
+
+ it('should contain a title', function() {
+ assert(LEXED.title);
+ });
+
+ it('should contain a description', function() {
+ assert(LEXED.description);
+ });
+
+ it('should extract the right title', function() {
+ assert.equal(LEXED.title, "This is the title");
+ });
+
+ it('should extract the right description', function() {
+ assert.equal(LEXED.description, "This is the book description.");
+ });
+});