Skip to content

Commit

Permalink
Test for passing args to listen
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron committed Nov 4, 2016
1 parent 22cea75 commit 00190c3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/unit/microphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ exports['av.Microphone'] = {
this.emitter.emit('close');
},

listenSpawnToPipe: function(test) {
listenSpawnToPipeDefault: function(test) {
test.expect(3);

var mic = new av.Microphone();
Expand All @@ -83,10 +83,23 @@ exports['av.Microphone'] = {
test.equal(this.spawn.callCount, 1);
test.equal(this.spawn.lastCall.args[0], 'arecord');
test.deepEqual(this.spawn.lastCall.args[1], [
'-f', 'cd', '-r', '48000', '-c', 1
'-f', 'cd', '-r', '48000'
]);

test.done();
},

listenSpawnToPipeWithArgs: function(test) {
test.expect(3);

var mic = new av.Microphone();

mic.listen(['foo', 'bar']);

test.equal(this.spawn.callCount, 1);
test.equal(this.spawn.lastCall.args[0], 'arecord');
test.deepEqual(this.spawn.lastCall.args[1], ['foo', 'bar']);
test.done();
},

};

0 comments on commit 00190c3

Please sign in to comment.