summaryrefslogtreecommitdiffstats
path: root/test/readme.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-01-28 23:23:56 +0100
committerSamy Pessé <samypesse@gmail.com>2016-01-28 23:23:56 +0100
commitff30ba62ba694658d1575b0cf3a0fbf3d5e00d62 (patch)
tree31ca85c3d2d93935eb6c351bd9e5ca317fc0e2a3 /test/readme.js
parentea98444dc0a6e59e79408963e1d340d7765ba9f6 (diff)
downloadgitbook-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.js43
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');
+ });
+ });
+ });
+});
+