diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-28 23:23:56 +0100 |
commit | ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62 (patch) | |
tree | 31ca85c3d2d93935eb6c351bd9e5ca317fc0e2a3 /test/readme.js | |
parent | ea98444dc0a6e59e79408963e1d340d7765ba9f6 (diff) | |
download | gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.zip gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.gz gitbook-ff30ba62ba694658d1575b0cf3a0fbf3d5e00d62.tar.bz2 |
Add order for tests
Diffstat (limited to 'test/readme.js')
-rw-r--r-- | test/readme.js | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/readme.js b/test/readme.js new file mode 100644 index 0000000..16aa81a --- /dev/null +++ b/test/readme.js @@ -0,0 +1,43 @@ +var mock = require('./mock'); + +describe('Readme', function() { + it('should parse empty readme', function() { + return mock.setupDefaultBook({ + 'README.md': '' + }) + .then(function(book) { + return book.prepareConfig() + + .then(function() { + return book.readme.load(); + }); + }); + }); + + it('should parse readme', function() { + return mock.setupDefaultBook({ + 'README.md': '# Hello World\nThis is my book' + }) + .then(function(book) { + return book.readme.load() + .then(function() { + book.readme.title.should.equal('Hello World'); + book.readme.description.should.equal('This is my book'); + }); + }); + }); + + it('should parse AsciiDoc readme', function() { + return mock.setupBook({ + 'README.adoc': '# Hello World\n\nThis is my book\n' + }) + .then(function(book) { + return book.readme.load() + .then(function() { + book.readme.title.should.equal('Hello World'); + book.readme.description.should.equal('This is my book'); + }); + }); + }); +}); + |