Skip to content

Commit

Permalink
Add beforeEach hook in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
aleafs committed Jun 23, 2012
1 parent 496957b commit 443cbe7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/filesplit.test.js
Expand Up @@ -3,8 +3,16 @@
var should = require('should');
var splitor = require(__dirname + '/../');

var cleanOutput = function (callback) {
require('child_process').exec('/bin/rm -f ' + __dirname + '/res/output*', {}, callback);
};

describe('file split', function () {

beforeEach(function (done) {
cleanOutput(done);
});

/* {{{ should_result_empty_when_empty_filelist() */
it('should_result_empty_when_empty_filelist', function (done) {
var split = splitor.create([]);
Expand Down Expand Up @@ -45,5 +53,11 @@ describe('file split', function () {
done();
});
});

/*
afterEach(function (done) {
cleanOutput(done);
});
*/
});

2 comments on commit 443cbe7

@aleafs
Copy link
Collaborator Author

@aleafs aleafs commented on 443cbe7 Jun 23, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ iseeyou1987 还有点细节没处理,基本能用了。刚刚在开发机上拿2.1G的数据测下来不到4分钟。性能细节还可以再优化。

@aleafs
Copy link
Collaborator Author

@aleafs aleafs commented on 443cbe7 Jun 24, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

刚刚的结果:

real 2m54.079s
user 2m49.234s
sys 0m6.351s

Please sign in to comment.