summaryrefslogtreecommitdiffstats
path: root/test/includes.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/includes.js')
-rw-r--r--test/includes.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/test/includes.js b/test/includes.js
deleted file mode 100644
index 6954d3f..0000000
--- a/test/includes.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-var assert = require('assert');
-
-var page = require('../').parse.page;
-var includer = require('../').parse.includer;
-
-var FIXTURES_DIR = path.join(__dirname, './fixtures/');
-
-function loadPage (name, options) {
- var CONTENT = fs.readFileSync(FIXTURES_DIR + name + '.md', 'utf8');
- return page(CONTENT, options).sections;
-}
-
-
-describe('Code includes', function() {
-
- var LEXED = loadPage('INCLUDES', {
- 'dir': FIXTURES_DIR,
- 'includer': includer({}, [
- FIXTURES_DIR
- ], path.join, fs.readFileSync)
- });
-
- var INCLUDED_C = fs.readFileSync(path.join(FIXTURES_DIR, 'included.c'), 'utf8');
-
- it('should work for snippets', function() {
- assert.equal(LEXED[0].type, 'normal');
- // Has replaced include
- assert.equal(
- LEXED[0].content.indexOf('{{ included.c }}'),
- -1
- );
- });
-
- it('should work for exercises', function() {
- assert.equal(LEXED[1].type, 'exercise');
-
- // Solution is trimmed version of source
- assert.equal(LEXED[1].code.solution, INCLUDED_C.trim());
- });
-});