summaryrefslogtreecommitdiffstats
path: root/test/paths.js
blob: 339da5106f02e98bdcceab6dedaa050bcf075d3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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'));
        });
    });
});