From d172aaefee8eb733d23a4e92abd79cbc4a43f801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Mon, 19 Jan 2015 15:31:58 +0100 Subject: Add test for glossary parsing --- test/fixtures/test1/GLOSSARY.md | 9 +++++++++ test/parsing.js | 12 ++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/fixtures/test1/GLOSSARY.md diff --git a/test/fixtures/test1/GLOSSARY.md b/test/fixtures/test1/GLOSSARY.md new file mode 100644 index 0000000..dc14550 --- /dev/null +++ b/test/fixtures/test1/GLOSSARY.md @@ -0,0 +1,9 @@ + +# Test + +a test text + +# Test 2 + +a second test + diff --git a/test/parsing.js b/test/parsing.js index 4aec3be..1464ed2 100644 --- a/test/parsing.js +++ b/test/parsing.js @@ -16,4 +16,16 @@ describe('Book parsing', function () { assert.equal(LEXED.chapters[1].path, 'test.md'); assert.equal(LEXED.chapters[2].path, 'test2.md'); }); + + it('should correctly parse the glossary', function() { + var LEXED = book1.glossary; + + assert.equal(LEXED[0].id, "test"); + assert.equal(LEXED[0].name, "Test"); + assert.equal(LEXED[0].description, "a test text"); + + assert.equal(LEXED[1].id, "test 2"); + assert.equal(LEXED[1].name, "Test 2"); + assert.equal(LEXED[1].description, "a second test"); + }); }); -- cgit v1.1