Remove unnecesare code from test helper

This commit is contained in:
Anatoliy Chakkaev 2012-02-04 22:17:27 +08:00 committed by Amir M. Mahmoudi
parent a23e3b66e6
commit 04cbad35fd
2 changed files with 1 additions and 23 deletions

View File

@ -2,7 +2,7 @@
"name": "jugglingdb",
"author": "Anatoliy Chakkaev",
"description": "ORM for every database: redis, mysql, neo4j, mongodb, postgres, sqlite",
"version": "0.0.8",
"version": "0.1.0",
"repository": {
"url": "https://github.com/1602/jugglingdb"
},

View File

@ -46,25 +46,3 @@ function check_external_exports() {
'require("spec_helper").init(exports); called');
}
// add assertions
var assert = require(require('module')._resolveFilename('../support/nodeunit')[0].replace(/index\.js$/, 'lib/assert'));
// Check response status code 200 OK
assert.status200 = function (response, message) {
if (response.statusCode !== 200) {
assert.fail(response.statusCode, 200, message || 'Status code is not 200', '===', assert.status200);
}
}
// Check redirection
assert.redirect = function (response, path, message) {
if (response.statusCode !== 302) {
assert.fail(response.statusCode, 302, 'Status code is not 302', '===', assert.redirect);
}
var realPath = require('url').parse(response.headers.location).pathname;
if (realPath !== path) {
assert.fail(realPath, path, message || 'Wrong location', '===', assert.redirect);
}
}