test readdir's symbolic link support

This commit is contained in:
Abir Viqar 2013-11-23 13:35:05 -05:00
parent e8df3e2e6b
commit 635dd2e899
1 changed files with 29 additions and 0 deletions

View File

@ -468,6 +468,35 @@ describe('fs.readdir', function() {
expect(_files[0]).toEqual('tmp');
});
});
it('should follow symbolic links', function() {
var complete = false;
var _error, _files;
var that = this;
that.fs.mkdir('/tmp', function(error) {
if(error) throw error;
that.fs.symlink('/', '/tmp/dirLink', function(error) {
if(error) throw error;
that.fs.readdir('/tmp/dirLink', function(error, result) {
_error = error;
_files = result;
complete = true;
});
});
});
waitsFor(function() {
return complete;
}, 'test to complete', DEFAULT_TIMEOUT);
runs(function() {
expect(_error).not.toBeDefined();
expect(_files.length).toEqual(1);
expect(_files[0]).toEqual('tmp');
});
});
});
describe('fs.rmdir', function() {