'use strict'
var test = require('tape')
var stream = require('stream')
var http = require('http')
var isStream = require('../../is/stream')

var testCases = [
// ['stream', expectedResult]
  [new stream.Readable(), true],
  [new stream.Writable(), true],
  [new stream.Duplex(), true]
]

test('isStream', function (t) {
  t.plan(testCases.length)
  testCases.forEach(function (item) {
    t.equals(isStream(item[0]), item[1], 'isStream(' + item[0].toString() + ') === ' + item[1])
  })
})

test('isStream (super-streams)', function (t) {
  t.plan(2)
  var req = http.get('http://perdu.com', function (res) {
    t.equals(isStream(res), true, 'isStream(http.ClientResponse) === true')
  })
  t.equals(isStream(req), true, 'isStream(http.ClientRequest) === true')
  // from: https://nodejs.org/api/http.html#http_class_http_clientrequest
  // "The request implements the Writable Stream interface."
})

@@ -204,32 +204,57 @@
 Readable(), true
+, 'new stream.Readable()'
 %5D,%0A  %5Bnew stream
@@ -270,16 +270,41 @@
 (), true
+, 'new stream.Writable()'
 %5D,%0A  %5Bne
@@ -326,16 +326,39 @@
 (), true
+, 'new stream.Duplex()'
 %5D%0A%5D%0A%0Ates
@@ -515,21 +515,852 @@
 tem%5B
-0%5D.toString()
+2%5D + ') === ' + item%5B1%5D)%0A  %7D)%0A%7D)%0A%0Avar readableCases = %5B%0A  %5Bnew stream.Readable(), true, 'new stream.Readable()'%5D,%0A  %5Bnew stream.Writable(), false, 'new stream.Writable()'%5D,%0A  %5Bnew stream.Duplex(), true, 'new stream.Duplex()'%5D%0A%5D%0A%0Atest('isStream.readable', function (t) %7B%0A  t.plan(readableCases.length)%0A  readableCases.forEach(function (item) %7B%0A    t.equals(isStream.readable(item%5B0%5D), item%5B1%5D, 'isStream.readable(' + item%5B2%5D + ') === ' + item%5B1%5D)%0A  %7D)%0A%7D)%0A%0Avar writableCases = %5B%0A  %5Bnew stream.Readable(), false, 'new stream.Readable()'%5D,%0A  %5Bnew stream.Writable(), true, 'new stream.Writable()'%5D,%0A  %5Bnew stream.Duplex(), true, 'new stream.Duplex()'%5D%0A%5D%0A%0Atest('isStream.writable', function (t) %7B%0A  t.plan(writableCases.length)%0A  writableCases.forEach(function (item) %7B%0A    t.equals(isStream.writable(item%5B0%5D), item%5B1%5D, 'isStream.writable(' + item%5B2%5D
  + '
@@ -1444,17 +1444,17 @@
  t.plan(
-2
+6
 )%0A  var 
@@ -1587,52 +1587,424 @@
 )%0A  
-%7D)%0A  t.equals(isStream(req), true, 'isStream
+  t.equals(isStream.readable(res), true, 'isStream.readable(http.ClientRequest) === true')%0A    t.equals(isStream.writable(res), false, 'isStream.writable(http.ClientRequest) === false')%0A  %7D)%0A  t.equals(isStream(req), true, 'isStream(http.ClientRequest) === true')%0A  t.equals(isStream.readable(req), false, 'isStream.readable(http.ClientRequest) === false')%0A  t.equals(isStream.writable(req), true, 'isStream.writable
 (htt

fix stream tests