diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-22 21:04:36 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-22 21:04:36 +0100 |
commit | 877f2e477b010f9f37a9044606f110a90f077680 (patch) | |
tree | 5cd61cf3b00ba10dc6110535ed9fdf67d8baba72 /test/readme.js | |
parent | c8e2fc0e57d223c01a51d6ee186fc1662cd74d13 (diff) | |
download | gitbook-877f2e477b010f9f37a9044606f110a90f077680.zip gitbook-877f2e477b010f9f37a9044606f110a90f077680.tar.gz gitbook-877f2e477b010f9f37a9044606f110a90f077680.tar.bz2 |
Start rewrite
Diffstat (limited to 'test/readme.js')
-rw-r--r-- | test/readme.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/readme.js b/test/readme.js new file mode 100644 index 0000000..0ebb490 --- /dev/null +++ b/test/readme.js @@ -0,0 +1,34 @@ +var mock = require('./mock'); + +describe('Readme', function() { + + describe('Parsing', 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'); + }); + }); + }); + }); + +}); + |