diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-18 12:15:53 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-18 12:15:53 +0100 |
commit | 202c235c665ff2dc007a013b45bff787ee82176b (patch) | |
tree | a3aea9acbadd53290ab2e7f1db63fb57946cff17 /test | |
parent | 576d773fecf5ec6a7ebf5b089ff7a03b102468eb (diff) | |
download | gitbook-202c235c665ff2dc007a013b45bff787ee82176b.zip gitbook-202c235c665ff2dc007a013b45bff787ee82176b.tar.gz gitbook-202c235c665ff2dc007a013b45bff787ee82176b.tar.bz2 |
Add tests for path utils module
Diffstat (limited to 'test')
-rw-r--r-- | test/all.js | 1 | ||||
-rw-r--r-- | test/paths.js | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/all.js b/test/all.js index 97913d7..d8f2275 100644 --- a/test/all.js +++ b/test/all.js @@ -1,6 +1,7 @@ // Utilities require('./location'); +require('./paths'); // Parsing require('./config'); diff --git a/test/paths.js b/test/paths.js new file mode 100644 index 0000000..c7929d3 --- /dev/null +++ b/test/paths.js @@ -0,0 +1,16 @@ +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('hello/test.html'); + pathUtils.setExtension('hello/test.md', '.json').should.be.equal('hello/test.json'); + }); + }); +}); |