diff options
-rw-r--r-- | test/fixtures/test0/README.md | 2 | ||||
-rw-r--r-- | test/glossary.js | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/fixtures/test0/README.md b/test/fixtures/test0/README.md index d26ab9b..a2fdfea 100644 --- a/test/fixtures/test0/README.md +++ b/test/fixtures/test0/README.md @@ -1,3 +1,3 @@ # Other Title -A description +This is a description, it's simple, no ? diff --git a/test/glossary.js b/test/glossary.js new file mode 100644 index 0000000..442f857 --- /dev/null +++ b/test/glossary.js @@ -0,0 +1,22 @@ +var path = require('path'); +var _ = require('lodash'); +var assert = require('assert'); +var cheerio = require('cheerio'); + +var fs = require("fs"); +var fsUtil = require("../lib/utils/fs"); + + +describe('Glossary Generation', function () { + it('should correctly replace glossary terms', function(done) { + testGeneration(books[0], "website", function(output) { + var content = fs.readFileSync(path.join(output, "index.html"), { encoding: "utf8" }); + var $ = cheerio.load(content); + + var $body = $(".page-inner"); + var $a = $("a[href='GLOSSARY.html#description']"); + assert($a.length == 1); + assert($a.text() == "description"); + }, done); + }); +}); |