Permalink
Browse files

implement destroy to satisify spec

  • Loading branch information...
1 parent b4cd8c1 commit a962299fb1060b1dd7f03d8c7a24c22a02a86371 @dominictarr committed Jul 12, 2012
Showing with 11 additions and 1 deletion.
  1. +3 −0 test/readable.js
  2. +8 −1 test/writable.js
View
@@ -48,6 +48,7 @@ invalid(function () {
//does not set readable = false, on 'end'
invalid(function () {
var s = new Stream()
+ s.destroy = function () {}
s._end = function () {
this.emit('end')
}
@@ -59,6 +60,7 @@ invalid(function () {
//does not set emit 'close'
invalid(function () {
var s = new Stream()
+ s.destroy = function () {}
s._end = function () {
this.readable = false
this.emit('end')
@@ -70,6 +72,7 @@ invalid(function () {
valid(function () {
var s = new Stream()
+ s.destroy = function () {}
s._end = function () {
this.readable = false
this.emit('end')
View
@@ -39,7 +39,8 @@ var invalid = checkValid(function (stream, spec) {
var wrong1 = function () {
var s = new Stream()
- s.write = function (){ }
+ s.write = function () {}
+ s.destroy = function () {}
//s.end = function () {}
//s.writable = true
return s
@@ -48,6 +49,7 @@ var wrong2 = //fails because end isn't defined
invalid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
//s.end = function () {}
s.writable = true
return s
@@ -57,6 +59,7 @@ invalid(function () {
invalid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
s.end = function () {}
//s.writable = true
return s
@@ -67,6 +70,7 @@ invalid(function () {
invalid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
s.end = function () {}
s.writable = true
return s
@@ -79,6 +83,7 @@ invalid(function () {
invalid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
s.end = function () {}
s.writable = true
return s
@@ -90,6 +95,7 @@ invalid(function () {
invalid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
s.end = function () {this.writable = false}
s.writable = true
return s
@@ -102,6 +108,7 @@ invalid(function () {
valid(function () {
var s = new Stream()
s.write = function (){ }
+ s.destroy = function () {}
s.end = function () {
this.writable = false
this.emit('close')

0 comments on commit a962299

Please sign in to comment.