Permalink
Browse files

factored out stream shim into its own file

  • Loading branch information...
1 parent 8effc6e commit 5960896e2e0cf5dab3be4c1e6f0776520f86dd73 @substack committed Oct 10, 2011
Showing with 10 additions and 10 deletions.
  1. +1 −10 test/get.js
  2. +9 −0 test/lib/stream.js
View
@@ -1,16 +1,7 @@
var test = require('tap').test;
var bouncy = require('../');
var http = require('http');
-
-var net = require('net');
-var Stream = function () {
- var s = new net.Stream;
- s.readable = true;
- s.writable = true;
- s.write = function (buf) { s.emit('data', buf) };
- s.end = function () { s.emit('end') };
- return s;
-};
+var Stream = require('./lib/stream');
test('GET with http', function (t) {
var port = Math.floor(Math.random() * (Math.pow(2,16) - 1e4) + 1e4);
View
@@ -0,0 +1,9 @@
+var net = require('net');
+module.exports = function () {
+ var s = new net.Stream;
+ s.readable = true;
+ s.writable = true;
+ s.write = function (buf) { s.emit('data', buf) };
+ s.end = function () { s.emit('end') };
+ return s;
+};

0 comments on commit 5960896

Please sign in to comment.