Comparing version 1.3.1 to 1.3.2
@@ -70,3 +70,4 @@ /* minimal couch in node | ||
* | ||
* @param {opts:object} request options; e.g. {db: "test", method: "GET"} | ||
* @param {opts:object|string} request options; | ||
* e.g. {db: "test", method: "GET"} | ||
* {opts.db:string} database name | ||
@@ -83,2 +84,3 @@ * {opts.method:string:optional} http method, defaults to "GET" | ||
function relax(opts,callback) { | ||
if(typeof opts === 'string') { opts = {path: opts}; } | ||
var log = logging(); | ||
@@ -90,3 +92,3 @@ var headers = { "content-type": "application/json" | ||
, headers: headers | ||
, uri : cfg.url + "/" + opts.db } | ||
, uri : cfg.url } | ||
, params = opts.params | ||
@@ -99,3 +101,3 @@ , status_code | ||
if (opts.jar) { req.jar = opts.jar; } | ||
if(opts.db) { req.uri += "/" + opts.db; } | ||
if(opts.path) { req.uri += "/" + opts.path; } | ||
@@ -102,0 +104,0 @@ else if(opts.doc) { |
@@ -5,3 +5,3 @@ { "name" : "nano" | ||
, "repository" : "git://github.com/dscape/nano" | ||
, "version" : "1.3.1" | ||
, "version" : "1.3.2" | ||
, "author" : "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)" | ||
@@ -8,0 +8,0 @@ , "contributors" : |
@@ -10,2 +10,4 @@ var ensure = require('ensure') | ||
couch = nock(cfg.url) | ||
.get('/') | ||
.reply(200, '{"couchdb":"Welcome","version":"1.1.0"}', {}) | ||
.get('/acb') | ||
@@ -36,2 +38,8 @@ .reply(404, "{\"error\":\"not_found\",\"reason\":\"no_db_file\"}\n", { server: 'CouchDB/1.1.1 (Erlang OTP/R14B04)', | ||
tests.root = function (callback) { nano(cfg.url).dinosaur('', callback); }; | ||
tests.root_ok = function (e,b) { | ||
this.t.ok(b.version); | ||
this.t.equal(b.version, "1.1.0"); | ||
}; | ||
tests.url = function (callback) { callback(null,nano('http://someurl.com')); }; | ||
@@ -38,0 +46,0 @@ tests.url_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com"); }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119153
2691