summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-01-28 16:36:17 +0100
committerSamy Pessé <samypesse@gmail.com>2015-01-28 16:36:17 +0100
commit56d1720aaea2472f12e045f61a2fb0bdf7da9343 (patch)
treeac1b18bd3851e3395d1dee9eca5a2ae11ee66c84 /test
parent02d7102c687c3d2295bd1586fe6e79f14396e740 (diff)
downloadgitbook-56d1720aaea2472f12e045f61a2fb0bdf7da9343.zip
gitbook-56d1720aaea2472f12e045f61a2fb0bdf7da9343.tar.gz
gitbook-56d1720aaea2472f12e045f61a2fb0bdf7da9343.tar.bz2
Improve image conversion to png to avoid doublons
Diffstat (limited to 'test')
-rw-r--r--test/ebook.js1
-rw-r--r--test/fixtures/test4/PAGE.md5
-rw-r--r--test/fixtures/test4/README.md1
-rw-r--r--test/fixtures/test4/SUMMARY.md2
4 files changed, 9 insertions, 0 deletions
diff --git a/test/ebook.js b/test/ebook.js
index e0083c8..05a2000 100644
--- a/test/ebook.js
+++ b/test/ebook.js
@@ -16,6 +16,7 @@ describe('eBook Generator', function () {
it('should correctly convert svg images to png', function(done) {
testGeneration(books[4], "ebook", function(output) {
assert(fs.existsSync(path.join(output, "test.png")));
+ assert(!fs.existsSync(path.join(output, "test_0.png")));
assert(fs.existsSync(path.join(output, "NewTux.png")));
}, done);
});
diff --git a/test/fixtures/test4/PAGE.md b/test/fixtures/test4/PAGE.md
new file mode 100644
index 0000000..0320232
--- /dev/null
+++ b/test/fixtures/test4/PAGE.md
@@ -0,0 +1,5 @@
+
+
+![test image to be converted](./test.svg)
+![test url](http://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg)
+![test image to be converted, second use](./test.svg)
diff --git a/test/fixtures/test4/README.md b/test/fixtures/test4/README.md
index 0d3bd13..19892a5 100644
--- a/test/fixtures/test4/README.md
+++ b/test/fixtures/test4/README.md
@@ -4,3 +4,4 @@ A description
![test image to be converted](./test.svg)
![test url](http://upload.wikimedia.org/wikipedia/commons/b/b0/NewTux.svg)
+![test image to be converted, second use](./test.svg)
diff --git a/test/fixtures/test4/SUMMARY.md b/test/fixtures/test4/SUMMARY.md
index ac9323c..44a33de 100644
--- a/test/fixtures/test4/SUMMARY.md
+++ b/test/fixtures/test4/SUMMARY.md
@@ -1 +1,3 @@
# Summary
+
+* [Page](PAGE.md)