From cee21845f63f5755212ae959b8dfcd0d9f890537 Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Sat, 11 Oct 2008 17:58:48 +0000 Subject: simplified CouchDB.port handling in tests git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@703698 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_tests.js | 6 +++--- test/test.js | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index 0339dda6..8876cab8 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -12,8 +12,7 @@ // Used by replication test CouchDB.host = (typeof window == 'undefined' || !window) ? - "127.0.0.1" : window.location.host; -CouchDB.port = 5984; + "127.0.0.1:5984" : window.location.host; var tests = { @@ -1868,8 +1867,9 @@ var tests = { // test that /_config returns all the settings var xhr = CouchDB.request("GET", "/_config"); var config = JSON.parse(xhr.responseText); + var port = CouchDB.host.split(':').pop() T(config.couchdb.database_dir); - T(config.httpd.port == CouchDB.port); + T(config.httpd.port == port); T(config.daemons.httpd); T(config.httpd_global_handlers._config); T(config.log.level); diff --git a/test/test.js b/test/test.js index 1d3e989b..e47153bd 100644 --- a/test/test.js +++ b/test/test.js @@ -118,11 +118,10 @@ var HTTP = (function() { // Monkeypatches to CouchDB client for use of curl. -CouchDB.host = (typeof window == 'undefined' || !window) ? "127.0.0.1" : window; -CouchDB.port = 5984; +CouchDB.host = (typeof window == 'undefined' || !window) ? "127.0.0.1:5984" : window; CouchDB.request = function(method, uri, options) { - var full_uri = "http://" + CouchDB.host + ":" + CouchDB.port + uri; + var full_uri = "http://" + CouchDB.host + uri; options = options || {}; var response = HTTP[method](full_uri, options.body, options.headers); return response; @@ -239,7 +238,6 @@ function T(arg1, arg2) { p("Running CouchDB Test Suite\n"); p("Host: "+CouchDB.host); -p("Port: "+CouchDB.port); try { p("Version: "+CouchDB.getVersion()+"\n"); -- cgit v1.2.3