diff --git a/tests/spec/idbfs.spec.js b/tests/spec/idbfs.spec.js index ff55dc5..887d154 100644 --- a/tests/spec/idbfs.spec.js +++ b/tests/spec/idbfs.spec.js @@ -1258,7 +1258,45 @@ describe('fs.link', function() { expect(_newstats).toEqual(_oldstats); }); }); + + it('should not follow symbolic links', function () { + var complete = false; + var _error, _oldstats, _linkstats, _newstats; + var that = this; + + that.fs.stat('/', function (error, result) { + if (error) throw error; + _oldstats = result; + that.fs.symlink('/', '/myfileLink', function (error) { + if (error) throw error; + that.fs.link('/myfileLink', '/myotherfile', function (error) { + if (error) throw error; + that.fs.lstat('/myfileLink', function (error, result) { + if (error) throw error; + _linkstats = result; + that.fs.lstat('/myotherfile', function (error, result) { + if (error) throw error; + _newstats = result; + complete = true; + }); + }); + }); + }); + }); + + waitsFor(function () { + return complete; + }, 'test to complete', DEFAULT_TIMEOUT); + + runs(function () { + expect(_error).not.toBeDefined(); + expect(_newstats.node).toEqual(_linkstats.node); + expect(_newstats.node).toNotEqual(_oldstats.node); + expect(_newstats.nlinks).toEqual(2); + expect(_newstats).toEqual(_linkstats); + }); }); + }); describe('fs.unlink', function() { beforeEach(function() {