2011-03-31 23:02:14 +02:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
|
|
|
var http = require('http');
|
|
|
|
|
|
|
|
var testServer = new http.Server(function(req, res) {
|
|
|
|
res.writeHead(200);
|
|
|
|
res.end('Hello world');
|
|
|
|
});
|
|
|
|
|
|
|
|
testServer.listen(common.PORT, function() {
|
|
|
|
http.get({ port: common.PORT }, function(res) {
|
|
|
|
assert.equal(res.readable, true, 'res.readable initially true');
|
|
|
|
res.on('end', function() {
|
|
|
|
assert.equal(res.readable, false, 'res.readable set to false after end');
|
|
|
|
testServer.close();
|
|
|
|
});
|
2012-12-13 16:47:33 +01:00
|
|
|
res.resume();
|
2011-03-31 23:02:14 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|