summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-09 08:23:11 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-09 08:23:11 +0200
commit99594791e0c34aee3659370b8c2072df815c9051 (patch)
tree5a523d3cbd3aec55a9bbf97beda7bff7605e9b62 /test
parent1b432288f041baef2ebe54c96a7a86f547b14c67 (diff)
parent2cc23b7e3411e1748bc8a25114a7bf9185a210f1 (diff)
downloadgitbook-99594791e0c34aee3659370b8c2072df815c9051.zip
gitbook-99594791e0c34aee3659370b8c2072df815c9051.tar.gz
gitbook-99594791e0c34aee3659370b8c2072df815c9051.tar.bz2
Merge Optional github
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/PAGE.md33
-rw-r--r--test/page.js10
2 files changed, 42 insertions, 1 deletions
diff --git a/test/fixtures/PAGE.md b/test/fixtures/PAGE.md
index 2839e6d..92ee707 100644
--- a/test/fixtures/PAGE.md
+++ b/test/fixtures/PAGE.md
@@ -30,3 +30,36 @@ Some more nice content ....
[Cool stuff](http://gitbook.io)
[Link to another Markdown file](./xyz/file.md)
+
+Lets go for another exercise but this time with some context :
+
+---
+
+Exercise with some context code :
+
+Using the `double` function provided, build a `quadruple` function
+
+```py
+
+```
+
+```py
+
+def quadruple(x):
+ return double(double(x))
+
+```
+
+```py
+assert(quadruple(8), 32)
+```
+
+```py
+
+def double(x):
+ return x * 2
+
+```
+
+---
+
diff --git a/test/page.js b/test/page.js
index 0f54809..658559e 100644
--- a/test/page.js
+++ b/test/page.js
@@ -16,7 +16,7 @@ var LINKS_CONTENT = fs.readFileSync(path.join(__dirname, './fixtures/GITHUB_LINK
describe('Page parsing', function() {
it('should detection sections', function() {
- assert.equal(LEXED.length, 3);
+ assert.equal(LEXED.length, 4);
});
it('should detection section types', function() {
@@ -36,6 +36,14 @@ describe('Page parsing', function() {
assert(LEXED[1].code.base);
assert(LEXED[1].code.solution);
assert(LEXED[1].code.validation);
+ assert(LEXED[1].code.context === null);
+
+ assert(LEXED[3].content);
+ assert(LEXED[3].code);
+ assert(LEXED[3].code.base);
+ assert(LEXED[3].code.solution);
+ assert(LEXED[3].code.validation);
+ assert(LEXED[3].code.context);
});
it('should merge sections correctly', function() {