summaryrefslogtreecommitdiff
path: root/test/simple/test-http-head-request.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-07-15 11:47:25 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-07-15 14:21:31 -0700
commit9fd5e3c89cb3664be7491c2da8e7060a0c36e135 (patch)
treed748de58c1638e852d33374c328a45f6ab8d2268 /test/simple/test-http-head-request.js
parent94728125696ce05f5308ccbc111874e9fa936936 (diff)
downloadnode-new-9fd5e3c89cb3664be7491c2da8e7060a0c36e135.tar.gz
Update tests to work with module contexts
Diffstat (limited to 'test/simple/test-http-head-request.js')
-rw-r--r--test/simple/test-http-head-request.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/simple/test-http-head-request.js b/test/simple/test-http-head-request.js
index befc8a2076..2bab5ee55b 100644
--- a/test/simple/test-http-head-request.js
+++ b/test/simple/test-http-head-request.js
@@ -1,4 +1,5 @@
-require('../common');
+common = require("../common");
+assert = common.assert
assert = require("assert");
http = require("http");
@@ -8,7 +9,7 @@ sys = require("sys");
body = "hello world\n";
server = http.createServer(function (req, res) {
- error('req: ' + req.method);
+ common.error('req: ' + req.method);
res.writeHead(200, {"Content-Length": body.length});
res.end();
server.close();
@@ -16,14 +17,14 @@ server = http.createServer(function (req, res) {
var gotEnd = false;
-server.listen(PORT, function () {
- var client = http.createClient(PORT);
+server.listen(common.PORT, function () {
+ var client = http.createClient(common.PORT);
var request = client.request("HEAD", "/");
request.end();
request.addListener('response', function (response) {
- error('response start');
+ common.error('response start');
response.addListener("end", function () {
- error('response end');
+ common.error('response end');
gotEnd = true;
});
});