diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-01-28 17:35:32 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-01-28 17:35:32 +0100 |
commit | 461ef2c68e9086bd77f0a25d57956ebf60308f7c (patch) | |
tree | c0e8814e3c57ea5bf21526acc3a7e9b1c925576a /test/glossary.js | |
parent | 46efdacd6d3d5c7560d8f956e2339c36157f7c89 (diff) | |
download | gitbook-461ef2c68e9086bd77f0a25d57956ebf60308f7c.zip gitbook-461ef2c68e9086bd77f0a25d57956ebf60308f7c.tar.gz gitbook-461ef2c68e9086bd77f0a25d57956ebf60308f7c.tar.bz2 |
Add unit tests for langs
Diffstat (limited to 'test/glossary.js')
-rw-r--r-- | test/glossary.js | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/test/glossary.js b/test/glossary.js deleted file mode 100644 index 116eabf..0000000 --- a/test/glossary.js +++ /dev/null @@ -1,75 +0,0 @@ -var should = require('should'); -var mock = require('./mock'); - -describe('Glossary', function() { - - describe('Parsing', 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 undefined return non existing entry', function() { - var entry = book.glossary.find('Hello'); - should.not.exist(entry); - }); - }); - }); - }); - -}); - |