summaryrefslogtreecommitdiffstats
path: root/test/codehighlighting.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/codehighlighting.js')
-rw-r--r--test/codehighlighting.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/codehighlighting.js b/test/codehighlighting.js
new file mode 100644
index 0000000..a64bf4b
--- /dev/null
+++ b/test/codehighlighting.js
@@ -0,0 +1,34 @@
+var _ = require('lodash');
+var should = require('should');
+var path = require('path');
+var fs = require('fs');
+
+var Plugin = require('../lib/plugin');
+var PLUGINS_ROOT = path.resolve(__dirname, 'plugins');
+
+describe('Code Highlighting', function () {
+ it('should correctly replace highlighting', function() {
+ return books.generate('highlight', 'website', {
+ prepare: function(book) {
+ var plugin = new Plugin(book, "highlight");
+ plugin.load("./highlight", PLUGINS_ROOT);
+
+ book.plugins.load(plugin);
+ }
+ })
+ .then(function(book) {
+ 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'
+ }
+ });
+ });
+ });
+});
+