summaryrefslogtreecommitdiffstats
path: root/test/readme.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
commitd3d64f636c859f7f01a64f7774cf70bd8ccdc562 (patch)
tree4f7731f37c3a793d187b0ab1cd77680e69534c6c /test/readme.js
parent4cb9cbb5ae3aa8f9211ffa3ac5e3d34232c0ca4f (diff)
parenteef072693b17526347c37b66078a5059c71caa31 (diff)
downloadgitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.zip
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.gz
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.bz2
Merge pull request #1109 from GitbookIO/3.0.0
Version 3.0.0
Diffstat (limited to 'test/readme.js')
-rw-r--r--test/readme.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/readme.js b/test/readme.js
new file mode 100644
index 0000000..0cf66ff
--- /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.config.load()
+
+ .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');
+ });
+ });
+ });
+});
+