Skip to content

Commit

Permalink
Tested with v0.6.12 on OSX Lion. Fixed vows unit tests. #hackerbreakf…
Browse files Browse the repository at this point in the history
…astcommit
  • Loading branch information
Justin Slattery committed Mar 4, 2012
1 parent 357b461 commit a44d6e7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Justin Slattery <Justin.Slattery@fzysqr.com> (http://fzysqr.com/)",
"name": "stalker",
"description": "Monitor directory trees for new files then do... something.",
"version": "0.0.16",
"version": "0.0.17",
"homepage": "https://github.com/jslatts/stalker",
"repository": {
"type": "git",
Expand All @@ -11,7 +11,7 @@
"main": "./lib/stalker.js",
"scripts": { "test": "vows spec/*" },
"engines": {
"node": ">= 0.4.8"
"node": ">= 0.6.12"
},
"dependencies": {},
"devDependencies": {}
Expand Down
55 changes: 38 additions & 17 deletions spec/stalker-vows.js
Expand Up @@ -58,9 +58,6 @@ vows.describe('stalker').addBatch({
var lPath = this.lPath;
assert.isNull(err);
assert.equal(file, lPath + '/temp');
fs.unlink(lPath + '/temp', function () {
fs.rmdirSync(lPath);
});
}
}
},
Expand All @@ -86,11 +83,6 @@ vows.describe('stalker').addBatch({
var oPath = lPath + '/inner';
assert.isNull(err);
assert.equal(file, lPath + '/temp');
fs.unlink(lPath + '/temp', function() {
fs.rmdir(oPath, function(err) {
fs.rmdir(lPath);
});
});
}
},
'calling stalker.watch on root dir with no recurse option and dropping file in nested ': {
Expand Down Expand Up @@ -123,12 +115,6 @@ vows.describe('stalker').addBatch({
var oPath = lPath + '/inner';

assert.isFalse(this.addCallBackFired[oPath + '/temp']);

fs.unlink(oPath + '/temp', function() {
fs.rmdir(oPath, function() {
fs.rmdir(lPath);
});
});
}
}
},
Expand Down Expand Up @@ -215,11 +201,46 @@ vows.describe('stalker').addBatch({
assert.equal(file, this.lPath + '/temp1');

assert.isFalse(this.addCallBackFired[this.lPath + '/temp2']);
}
}
}
}).addBatch({
'cleanup': {
'delete files': function () {
fs.rmdirSync(tPath + '/outer1/inner');
try {
fs.unlinkSync(tPath + '/outer1/temp');
}
catch (a) {
//Do nothing
}
fs.rmdirSync(tPath + '/outer1');

var lPath = this.lPath;
fs.unlinkSync(lPath + '/temp2');
fs.rmdirSync(lPath);
try {
fs.unlinkSync(tPath + '/outer2/inner/temp');
}
catch (a) {
//Do nothing
}
fs.rmdirSync(tPath + '/outer2/inner');
fs.rmdirSync(tPath + '/outer2');

try {
fs.unlinkSync(tPath + '/s1/temp');
}
catch (a) {
//Do nothing
}
fs.rmdirSync(tPath + '/s1');

try {
fs.unlinkSync(tPath + '/s3/temp2');
}
catch (a) {
//Do nothing
}
fs.rmdirSync(tPath + '/s3');

}
}
}).export(module);
Expand Down

0 comments on commit a44d6e7

Please sign in to comment.