summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-10-05 10:07:04 +0200
committerSamy Pessé <samypesse@gmail.com>2015-10-05 10:07:04 +0200
commit74396e7240f00b6f38239eedf2b10547a4868b4c (patch)
treea1630e4c74ac6ae32726c8ca31b1c99d5e005509 /test
parent6c2539e886a2893aa7d9bd4c4f84260145de6bd1 (diff)
downloadgitbook-74396e7240f00b6f38239eedf2b10547a4868b4c.zip
gitbook-74396e7240f00b6f38239eedf2b10547a4868b4c.tar.gz
gitbook-74396e7240f00b6f38239eedf2b10547a4868b4c.tar.bz2
Add method book.formatString
Diffstat (limited to 'test')
-rw-r--r--test/configuration.js34
-rw-r--r--test/format.js11
2 files changed, 28 insertions, 17 deletions
diff --git a/test/configuration.js b/test/configuration.js
index c96c10d..d30fd61 100644
--- a/test/configuration.js
+++ b/test/configuration.js
@@ -1,37 +1,37 @@
-describe("Configuration", function () {
- it("should extract default title from README", function() {
- return books.parse("basic")
+describe('Configuration', function () {
+ it('should extract default title from README', function() {
+ return books.parse('basic')
.then(function(book) {
- book.options.title.should.be.equal("Readme");
+ book.options.title.should.be.equal('Readme');
});
});
- it("should extract default description from README", function() {
- return books.parse("basic")
+ it('should extract default description from README', function() {
+ return books.parse('basic')
.then(function(book) {
- book.options.description.should.be.equal("Default description for the book.");
+ book.options.description.should.be.equal('Default description for the book.');
});
});
- it("should correctly load from json (book.json)", function() {
- return books.parse("config-json")
+ it('should correctly load from json (book.json)', function() {
+ return books.parse('config-json')
.then(function(book) {
- book.options.title.should.be.equal("json-config");
+ book.options.title.should.be.equal('json-config');
});
});
- it("should correctly load from JavaScript (book.js)", function() {
- return books.parse("config-js")
+ it('should correctly load from JavaScript (book.js)', function() {
+ return books.parse('config-js')
.then(function(book) {
- book.options.title.should.be.equal("js-config");
+ book.options.title.should.be.equal('js-config');
});
});
- it("should provide configuration on book.config.get", function() {
- return books.parse("basic")
+ it('should provide configuration on book.config.get', function() {
+ return books.parse('basic')
.then(function(book) {
- book.config.get("description").should.be.equal("Default description for the book.");
- book.getConfig("description").should.be.equal("Default description for the book.");
+ book.config.get('description').should.be.equal('Default description for the book.');
+ book.getConfig('description').should.be.equal('Default description for the book.');
});
});
});
diff --git a/test/format.js b/test/format.js
new file mode 100644
index 0000000..2ec1a6f
--- /dev/null
+++ b/test/format.js
@@ -0,0 +1,11 @@
+describe('Formatting', function () {
+ it('should provide formatting with book.formatString', function() {
+ return books.parse('basic')
+ .then(function(book) {
+ return book.formatString('markdown', 'this is a **test**');
+ })
+ .then(function(content) {
+ content.should.equal('<p>this is a <strong>test</strong></p>\n');
+ });
+ });
+});