summaryrefslogtreecommitdiffstats
path: root/test/paths.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-26 09:41:26 +0100
commitd3d64f636c859f7f01a64f7774cf70bd8ccdc562 (patch)
tree4f7731f37c3a793d187b0ab1cd77680e69534c6c /test/paths.js
parent4cb9cbb5ae3aa8f9211ffa3ac5e3d34232c0ca4f (diff)
parenteef072693b17526347c37b66078a5059c71caa31 (diff)
downloadgitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.zip
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.gz
gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.bz2
Merge pull request #1109 from GitbookIO/3.0.0
Version 3.0.0
Diffstat (limited to 'test/paths.js')
-rw-r--r--test/paths.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/paths.js b/test/paths.js
new file mode 100644
index 0000000..339da51
--- /dev/null
+++ b/test/paths.js
@@ -0,0 +1,17 @@
+var path = require('path');
+var pathUtils = require('../lib/utils/path');
+
+describe('Paths', function() {
+
+ describe('setExtension', function() {
+ it('should correctly change extension of filename', function() {
+ pathUtils.setExtension('test.md', '.html').should.be.equal('test.html');
+ pathUtils.setExtension('test.md', '.json').should.be.equal('test.json');
+ });
+
+ it('should correctly change extension of path', function() {
+ pathUtils.setExtension('hello/test.md', '.html').should.be.equal(path.normalize('hello/test.html'));
+ pathUtils.setExtension('hello/test.md', '.json').should.be.equal(path.normalize('hello/test.json'));
+ });
+ });
+});