diff options
Diffstat (limited to 'packages/gitbook-asciidoc/test/readme.js')
-rwxr-xr-x | packages/gitbook-asciidoc/test/readme.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/gitbook-asciidoc/test/readme.js b/packages/gitbook-asciidoc/test/readme.js new file mode 100755 index 0000000..0bca343 --- /dev/null +++ b/packages/gitbook-asciidoc/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.adoc'), '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."); + }); +}); |