diff --git a/tests/spec/fs.watch.spec.js b/tests/spec/fs.watch.spec.js index 60510a1..d537a7f 100644 --- a/tests/spec/fs.watch.spec.js +++ b/tests/spec/fs.watch.spec.js @@ -73,6 +73,35 @@ describe('fs.watch', function() { if(error) throw error; }); }); + + it('should get a change event when a file hardlink is being watched and the original file is changed', function(done) { + var fs = util.fs(); + + fs.writeFile('/myfile', 'data', function(error) { + if(error) throw error; + + fs.link('/myfile', '/hardlink', function(error) { + if(error) throw error; + + var watcher = fs.watch('/hardlink', function(event, filename) { + expect(event).to.equal('change'); + expect(filename).to.equal('/hardlink'); + watcher.close(); + done(); + }); + + fs.appendFile('/myfile', '...more data', function(error) { + if(error) throw error; + + fs.readFile('/hardlink', 'utf8', function(error, data) { + if(error) throw error; + + expect(data).to.equal('data...more data') + }); + }); + }); + }); + }); }); it('should get a change event when renaming a file', function(done) {