Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
no longer any need for on('ready', fn) in the write stream tests; all…
Browse files Browse the repository at this point in the history
… tests pass
  • Loading branch information
James Halliday committed Aug 17, 2013
1 parent 8407b85 commit 15c53d7
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions test/write-stream-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ buster.testCase('WriteStream', {
this.sourceData.forEach(function (d) {
ws.write(d)
})
ws.once('ready', ws.end) // end after it's ready, nextTick makes this work OK
ws.end()
}.bind(this))
}

Expand Down Expand Up @@ -160,7 +160,7 @@ buster.testCase('WriteStream', {
this.sourceData.forEach(function (d) {
ws.write(d)
})
ws.once('ready', ws.destroySoon) // end after it's ready, nextTick makes this work OK
ws.destroySoon()
}.bind(this))
}

Expand Down Expand Up @@ -196,7 +196,7 @@ buster.testCase('WriteStream', {
})
assert.isTrue(ws.writable)
assert.isFalse(ws.readable)
ws.once('ready', ws.destroy)
ws.destroy()
}.bind(this))
}

Expand All @@ -223,7 +223,7 @@ buster.testCase('WriteStream', {
data.forEach(function (d) {
ws.write(d)
})
ws.once('ready', ws.end) // end after it's ready, nextTick makes this work OK
ws.end()
}.bind(this))
}

Expand Down Expand Up @@ -260,8 +260,7 @@ buster.testCase('WriteStream', {
ws.write(d)
})

// end after it's ready, nextTick makes this work OK
ws.once('ready', ws.end)
ws.end()
},
function (db, cb) {
var delStream = db.createWriteStream()
Expand All @@ -276,8 +275,7 @@ buster.testCase('WriteStream', {
delStream.write(d)
})

// end after it's ready, nextTick makes this work OK
delStream.once('ready', delStream.end)
delStream.end()
},
function (db, cb) {
async.forEach(
Expand Down Expand Up @@ -329,8 +327,7 @@ buster.testCase('WriteStream', {
ws.write(d)
})

// end after it's ready, nextTick makes this work OK
ws.once('ready', ws.end)
ws.end()
},
function (db, cb) {
var delStream = db.createWriteStream({ type: 'del' })
Expand All @@ -344,8 +341,7 @@ buster.testCase('WriteStream', {
delStream.write(d)
})

// end after it's ready, nextTick makes this work OK
delStream.once('ready', delStream.end)
delStream.end()
},
function (db, cb) {
async.forEach(
Expand Down Expand Up @@ -400,8 +396,7 @@ buster.testCase('WriteStream', {
ws.write(d)
})

// end after it's ready, nextTick makes this work OK
ws.once('ready', ws.end)
ws.end()
},
function (db, cb) {
var delStream = db.createWriteStream({ type: 'del' })
Expand All @@ -415,8 +410,7 @@ buster.testCase('WriteStream', {
delStream.write(d)
})

// end after it's ready, nextTick makes this work OK
delStream.once('ready', delStream.end)
delStream.end()
},
function (db, cb) {
async.forEach(
Expand Down Expand Up @@ -455,7 +449,7 @@ buster.testCase('WriteStream', {
d.type = "x" + Math.random()
ws.write(d)
})
ws.once('ready', ws.end) // end after it's ready, nextTick makes this work OK
ws.end()
}.bind(this),
function (db, cb) {
async.forEach(
Expand Down

0 comments on commit 15c53d7

Please sign in to comment.