-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest.js
31 lines (25 loc) · 826 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use strict";
var proxyquire = require('proxyquire');
var should = require('should');
describe('git-spawned-stream', function() {
it('should delegate with the correct params', function(done) {
var spawnArgs = ['rev-list', '--max-count=2', 'HEAD'];
var limit = 1024 * 1024;
var gitSpawnedStream = proxyquire.load('./index', {
'spawn-to-readstream': function(spawnStream, bytes) {
spawnStream.should.eql('spawnStream');
bytes.should.eql(limit);
done();
},
'child_process': {
spawn: function(cmd, args) {
spawnArgs.unshift('--git-dir=/home/node.git');
cmd.should.eql('git');
args.should.eql(spawnArgs);
return 'spawnStream';
}
}
});
gitSpawnedStream('/home/node.git', spawnArgs, limit);
});
});