Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #11 from goodeggs/symlinks

Version symlinks
  • Loading branch information...
commit 53d91c63da2c8e7349bc07f819a16f32c2bd117d 2 parents 0413236 + 01d7f4f
@serby authored
Showing with 27 additions and 5 deletions.
  1. +4 −1 lib/map-path.js
  2. +23 −4 test/map-path.test.js
View
5 lib/map-path.js
@@ -75,7 +75,10 @@ module.exports = function(dirPath, params, callback) {
.on('file', function(filename) {
files.push(filename)
})
+ .on('symlink', function(filename) {
+ files.push(filename)
+ })
.on('end', function() {
makeHashMap(callback)
})
-}
+}
View
27 test/map-path.test.js
@@ -44,9 +44,7 @@ describe('versionator', function() {
};
before(function(done) {
- createFiles(tmpPath, files, function() {
- done();
- });
+ createFiles(tmpPath, files, done);
});
describe('map path validation', function() {
@@ -89,9 +87,30 @@ describe('versionator', function() {
});
+ describe('with a symlink', function(done) {
+ beforeEach(function(done) {
+ fs.symlink(tmpPath + '/b', tmpPath + '/b_symlink', 'file', done);
+ });
+
+ it('create hash for symlink', function(done) {
+ versionator.createMapFromPath(tmpPath, function(error, results) {
+
+ results['/b_symlink'].should.equal('/8b1a9953c4611296a827abf8c47804d7/b_symlink');
+
+ done()
+ });
+
+ });
+
+ afterEach(function(done) {
+ fs.unlink(tmpPath + '/b_symlink', done);
+ });
+
+ });
+
});
after(function(done) {
removeFiles(tmpPath, files, done);
});
-});
+});
Please sign in to comment.
Something went wrong with that request. Please try again.