summaryrefslogtreecommitdiffstats
path: root/test/glossary.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-30 22:06:16 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-30 22:06:16 +0200
commitc1d53ec11fbe085932df911bda5686b7bf671f53 (patch)
tree97ae6db641eb79ec9b061af136a0b2e3c549db55 /test/glossary.js
parent36b49c66c6b75515bc84dd678fd52121a313e8d2 (diff)
downloadgitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.zip
gitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.tar.gz
gitbook-c1d53ec11fbe085932df911bda5686b7bf671f53.tar.bz2
Switch parsers to a model
Diffstat (limited to 'test/glossary.js')
-rw-r--r--test/glossary.js71
1 files changed, 0 insertions, 71 deletions
diff --git a/test/glossary.js b/test/glossary.js
deleted file mode 100644
index e1ba82a..0000000
--- a/test/glossary.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var should = require('should');
-var mock = require('./mock');
-
-describe('Glossary', function() {
- it('should parse empty glossary', function() {
- return mock.setupDefaultBook({
- 'GLOSSARY.md': ''
- })
- .then(function(book) {
- return book.prepareConfig()
-
- .then(function() {
- return book.glossary.load();
- })
- .then(function() {
- book.glossary.isEmpty().should.be.true();
- });
- });
- });
-
- describe('Non-empty glossary', function() {
- var book;
-
- before(function() {
- return mock.setupDefaultBook({
- 'GLOSSARY.md': '# Glossary\n\n## Hello World\n\nThis is an entry'
- })
- .then(function(_book) {
- book = _book;
- return book.prepareConfig();
- })
- .then(function() {
- return book.glossary.load();
- });
- });
-
- it('should not be empty', function() {
- book.glossary.isEmpty().should.be.false();
- });
-
- describe('glossary.get', function() {
- it('should return an existing entry', function() {
- var entry = book.glossary.get('hello_world');
- should.exist(entry);
-
- entry.name.should.equal('Hello World');
- entry.description.should.equal('This is an entry');
- entry.id.should.equal('hello_world');
- });
-
- it('should undefined return non existing entry', function() {
- var entry = book.glossary.get('cool');
- should.not.exist(entry);
- });
- });
-
- describe('glossary.find', function() {
- it('should return an existing entry', function() {
- var entry = book.glossary.find('HeLLo World');
- should.exist(entry);
- entry.id.should.equal('hello_world');
- });
-
- it('should return undefined for non existing entry', function() {
- var entry = book.glossary.find('Hello');
- should.not.exist(entry);
- });
- });
- });
-});
-