Permalink
Browse files

fixup tests

  • Loading branch information...
1 parent b30cc6c commit 8e4061fb20ffd36da3c5444c50aa82d7b4ed6b1d Dane Springmeyer committed Apr 18, 2012
Showing with 7 additions and 13 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 Makefile
  3. 0 test/tmp/placeholder.txt
  4. +4 −11 test/write.test.js
View
@@ -5,4 +5,5 @@ build
*.a
lib/_zipfile.node
deps/libzip-*/
-node_modules
+node_modules
+test/tmp/
View
@@ -23,7 +23,7 @@ uninstall:
node-waf -v uninstall
test:
- @NODE_PATH=.:./lib:$NODE_PATH mocha -r zipfile -r assert
+ @PATH=./node_modules/mocha/bin:${PATH} && NODE_PATH=./lib:$NODE_PATH mocha -R spec
fix:
@fixjsstyle lib/*js bin/*js test/*js
View
No changes.
View
@@ -8,11 +8,9 @@ var constants = require('constants');
describe('Async Writes', function(){
var zf = new zipfile.ZipFile('./test/data/world_merc.zip');
- var wrote = 0;
-
- it('async write', function(done){
- zf.names.forEach(function(name) {
- var dest = path.join('/tmp/async', name);
+ zf.names.forEach(function(name) {
+ it('async write '+ name, function(done){
+ var dest = path.join(__dirname,'/tmp/', name);
support.mkdirP(path.dirname(dest), 0755 , function(err) {
if (err) throw err;
if (path.extname(name)) {
@@ -25,9 +23,8 @@ describe('Async Writes', function(){
// written is number of bytes written
assert.ok(written > 0);
fs.close(fd, function(err) {
- wrote++;
- if (wrote >= 4) done();
if (err) throw err;
+ done();
});
});
});
@@ -37,10 +34,6 @@ describe('Async Writes', function(){
});
});
- after(function(){
- assert.equal(wrote, 4);
- });
-
});
describe('Sync Writes', function(){

0 comments on commit 8e4061f

Please sign in to comment.