diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-14 19:21:43 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-14 19:21:43 +0200 |
commit | c0ca055bf4c5cbc776b2822afaa3a1efb1b97c19 (patch) | |
tree | 32c27c03056f7ff78085004d871451987ee4fb18 /test/readme.js | |
parent | f43e630528be43d5aec4e6f923b0f53107f93546 (diff) | |
download | gitbook-c0ca055bf4c5cbc776b2822afaa3a1efb1b97c19.zip gitbook-c0ca055bf4c5cbc776b2822afaa3a1efb1b97c19.tar.gz gitbook-c0ca055bf4c5cbc776b2822afaa3a1efb1b97c19.tar.bz2 |
Add readme parsing for extracting title and description
Diffstat (limited to 'test/readme.js')
-rw-r--r-- | test/readme.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/readme.js b/test/readme.js new file mode 100644 index 0000000..811591c --- /dev/null +++ b/test/readme.js @@ -0,0 +1,28 @@ +var fs = require('fs'); +var path = require('path'); +var assert = require('assert'); + +var readme = require('../').parse.readme; + + +var CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/README.md'), '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."); + }); +}); |