summaryrefslogtreecommitdiffstats
path: root/test/plugins.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/plugins.js')
-rw-r--r--test/plugins.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/plugins.js b/test/plugins.js
index d10e0b5..a81110c 100644
--- a/test/plugins.js
+++ b/test/plugins.js
@@ -1,6 +1,7 @@
var _ = require('lodash');
var should = require('should');
var path = require('path');
+var fs = require('fs');
var Plugin = require('../lib/plugin');
var parsers = require("gitbook-parsers");
@@ -234,5 +235,31 @@ describe('Plugins', function () {
});
});
});
+
+ describe('Replace code highlighting', function() {
+ it('should correctly replace highlighting', function() {
+ return books.generate('basic', 'website', {
+ before: function(book) {
+ var plugin = new Plugin(book, "blocks");
+ plugin.load("./highlight", PLUGINS_ROOT);
+
+ return book.plugins.load(plugin);
+ }
+ })
+ .then(function() {
+ var PAGE = fs.readFileSync(
+ path.join(book.options.output, "index.html"),
+ { encoding: "utf-8" }
+ );
+
+ PAGE.should.be.html({
+ "code": {
+ count: 1,
+ text: 'code__test\n__code'
+ }
+ });
+ });
+ })
+ });
});