diff --git a/lib/helper.js b/lib/helper.js index ea1acf6..f63201f 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -56,7 +56,7 @@ helper.flatToTree = function flatToTree(files, cwd, relative, unixify, done) { // If we want relative paths if (relative === true) { if (path.resolve(parent) === path.resolve(cwd)) { - parent = '.'; + parent = './'; } else { parent = path.relative(cwd, parent) + path.sep; } @@ -66,7 +66,7 @@ helper.flatToTree = function flatToTree(files, cwd, relative, unixify, done) { // If we want to transform paths to unix seps if (unixify === true) { filepath = helper.unixifyPathSep(filepath); - if (parent !== '.') { + if (parent !== './') { parent = helper.unixifyPathSep(parent); } } diff --git a/test/api_test.js b/test/api_test.js index 9593468..929f76f 100644 --- a/test/api_test.js +++ b/test/api_test.js @@ -15,7 +15,7 @@ exports.api = { new gaze.Gaze('**/*', {}, function() { this.relative(null, true, function(err, result) { var result = helper.sortobj(result); - test.deepEqual(result['.'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']); + test.deepEqual(result['./'], ['Project (LO)/', 'nested/', 'one.js', 'sub/']); test.deepEqual(result['sub/'], ['one.js', 'two.js']); this.on('end', test.done); this.close(); diff --git a/test/helper_test.js b/test/helper_test.js index bf453d3..5c88051 100644 --- a/test/helper_test.js +++ b/test/helper_test.js @@ -45,7 +45,7 @@ exports.helper = { '/Users/dude/www/sub/nested/one.js', ]; var expected = { - '.': ['one.js', 'two.js', 'sub/'], + './': ['one.js', 'two.js', 'sub/'], 'sub/': ['one.js', 'nested/'], 'sub/nested/': ['one.js'], }; diff --git a/test/matching_test.js b/test/matching_test.js index 9626dc3..9f274a2 100644 --- a/test/matching_test.js +++ b/test/matching_test.js @@ -30,7 +30,7 @@ exports.matching = { test.expect(2); gaze('**/*', function() { this.relative(null, true, function(err, result) { - test.deepEqual(sortobj(result['.']), sortobj(['Project (LO)/', 'nested/', 'one.js', 'sub/'])); + test.deepEqual(sortobj(result['./']), sortobj(['Project (LO)/', 'nested/', 'one.js', 'sub/'])); test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js'])); this.on('end', test.done); this.close(); @@ -51,7 +51,7 @@ exports.matching = { test.expect(2); gaze(['*.js', 'sub/*.js'], function() { this.relative(null, true, function(err, result) { - test.deepEqual(sortobj(result['.']), sortobj(['one.js', 'sub/'])); + test.deepEqual(sortobj(result['./']), sortobj(['one.js', 'sub/'])); test.deepEqual(sortobj(result['sub/']), sortobj(['one.js', 'two.js'])); this.on('end', test.done); this.close(); diff --git a/test/watch_test.js b/test/watch_test.js index a41f7b4..0306910 100644 --- a/test/watch_test.js +++ b/test/watch_test.js @@ -38,7 +38,7 @@ exports.watch = { this.remove(path.resolve(__dirname, 'fixtures')); this.relative(null, true, function(err, result) { test.deepEqual(result['sub/'], ['one.js']); - test.notDeepEqual(result['.'], ['one.js']); + test.notDeepEqual(result['./'], ['one.js']); this.on('end', test.done); this.close(); }.bind(this)); @@ -196,7 +196,7 @@ exports.watch = { }, function(err, watcher) { watcher.on('changed', function(filepath) { this.relative(function(err, result) { - test.deepEqual(result, {'.':['two.js']}); + test.deepEqual(result, {'./':['two.js']}); watcher.close(); }); });