Skip to content

Commit 89a3122

Browse files
committed
Add more test
1 parent 0110308 commit 89a3122

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

lib/responseData.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ function ResData(nodeRes) {
44
this.redirect = false;
55
this.headers = {};
66
this.body = null;
7+
this.dispPath = null;
8+
this.reqBody = false;
79
}
810

911
ResData.prototype.getRespHeader = function(string) {
@@ -44,11 +46,11 @@ ResData.prototype.doRedirect = function(bool) {
4446
};
4547

4648
ResData.prototype.setDispPath = function(string) {
47-
49+
this.dispPath = string;
4850
};
4951

5052
ResData.prototype.setReqBody = function(binary) {
51-
53+
this.reqBody = binary;
5254
};
5355

5456
ResData.prototype.setRespBody = function(body) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"author": "Eric Redmond <eric.redmond@gmail.com>",
33
"name": "webmachine",
44
"description": "Webmachine Application Server",
5-
"version": "0.0.1",
5+
"version": "0.0.2",
66
"preferGlobal": "true",
77
"repository": {
88
"type": "git",

test/responseData-test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ vows.describe('Server').addBatch({
1414
resData.setRespHeader('Location', '/tmp');
1515
resData.setRespBody('data');
1616
resData.doRedirect(true);
17+
resData.setDispPath('/tmp');
18+
resData.setReqBody(true);
1719
this.callback(undefined, resData);
1820
},
1921
'and fields exist': function (err, resData) {
@@ -32,6 +34,12 @@ vows.describe('Server').addBatch({
3234
'and respRedirect': function (err, resData) {
3335
assert.equal(resData.respRedirect(), true);
3436
},
37+
'and dispPath': function (err, resData) {
38+
assert.equal(resData.dispPath, '/tmp');
39+
},
40+
'and reqBody': function (err, resData) {
41+
assert.equal(resData.reqBody, true);
42+
},
3543
'and statusCode': function (err, resData) {
3644
assert.equal(resData.statusCode(), 200);
3745
}

0 commit comments

Comments
 (0)