Fix the flush() mock so it works if not given a callback.

This commit is contained in:
James Coglan
2014-12-15 19:20:56 +00:00
parent 983c0d30c3
commit cc2978bdfb
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ test.describe("ClientSession", function() { with(this) {
this.stub(stream, "removeListener")
this.stub(stream, "write")
this.stub(stream, "flush").yields([])
this.stub(stream, "flush", function(cb) { if(cb) cb() });
this.stub(stream, "close").raises(new Error("unexpected close()"))
return stream
+1 -1
View File
@@ -25,7 +25,7 @@ test.describe("ClientSession", function() { with(this) {
this.stub(stream, "removeListener")
this.stub(stream, "write")
this.stub(stream, "flush").yields([])
this.stub(stream, "flush", function(cb) { if(cb) cb() });
this.stub(stream, "close").raises(new Error("unexpected close()"))
return stream