Comparing version 0.9.1 to 0.9.2
@@ -1,14 +0,17 @@ | ||
{ "name": "nano" | ||
, "description": "minimalistic couchdb driver for node.js" | ||
, "homepage": "http://github.com/dscape/nano" | ||
, "repository": "git://github.com/dscape/nano" | ||
, "version": "0.9.1" | ||
, "author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)" | ||
, "contributors": ["Thiago Arrais <thiago.arrais@gmail.com> (http://thiagoarrais.com)"] | ||
, "keywords": ["couchdb", "data", "request", "json", "nosql", "micro", "nano"] | ||
, "dependencies": {"request": "~2.1.1", "underscore": "~1.1.7"} | ||
, "devDependencies": { "async": "~0.1.9", "ensure": "0.1.x" } | ||
, "scripts": { "test": "./tests/run" } | ||
, "main": "./nano.js" | ||
, "engines" : { "node": ">=0.3.6" } | ||
{ "name" : "nano" | ||
, "description" : "minimalistic couchdb driver for node.js" | ||
, "homepage" : "http://github.com/dscape/nano" | ||
, "repository" : "git://github.com/dscape/nano" | ||
, "version" : "0.9.2" | ||
, "author" : "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com)" | ||
, "contributors" : | ||
[ "Thiago Arrais <thiago.arrais@gmail.com> (http://thiagoarrais.com)" | ||
, "Derek Perez <derek@derekperez.com> (http://blog.derekperez.com)" | ||
] | ||
, "keywords" : ["couchdb", "data", "request", "json", "nosql", "micro", "nano"] | ||
, "dependencies" : {"request": "~2.1.1", "underscore": "~1.1.7"} | ||
, "devDependencies" : { "async": "~0.1.9", "ensure": "0.4.x" } | ||
, "scripts" : { "test": "./node_modules/ensure/bin/tap.js tests/*/*.js" } | ||
, "main" : "./nano.js" | ||
, "engines" : { "node": ">=0.3.6" } | ||
} |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -21,7 +20,7 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.equal(b.id, "new"); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.equal(b.id, "new"); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -28,7 +27,7 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
this.t.notOk(e); | ||
var from_buffer = new Buffer(b, "binary").toString("base64"); | ||
assert.equal(from_buffer, pixel); | ||
this.t.equal(from_buffer, pixel); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -18,7 +17,7 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.equal(b.id, "new"); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.equal(b.id, "new"); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, fs = require('fs') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -33,3 +32,3 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("a")); | ||
assert.equal(fs.readFileSync(file_name("a")).toString("base64"), pixel); | ||
this.t.equal(fs.readFileSync(file_name("a")).toString("base64"), pixel); | ||
fs.unlinkSync(file_name("a")); | ||
@@ -36,0 +35,0 @@ }; |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -25,7 +24,7 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("b")); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.equal(b.id, "new"); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.equal(b.id, "new"); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -26,7 +25,7 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
assert.equal(b.results.length,1); | ||
assert.equal(b.last_seq,3); | ||
this.t.notOk(e); | ||
this.t.equal(b.results.length,1); | ||
this.t.equal(b.last_seq,3); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -27,7 +26,7 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy("db_co1"); | ||
assert.isNull(err); | ||
assert.equal(list.doc_count, 3); | ||
assert.equal(list.doc_del_count, 0); | ||
this.t.notOk(err); | ||
this.t.equal(list.doc_count, 3); | ||
this.t.equal(list.doc_del_count, 0); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -15,6 +14,6 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy("db_cr1"); | ||
assert.isNull(e); | ||
assert.equal(b.ok, true); | ||
this.t.notOk(e); | ||
this.t.equal(b.ok, true); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -14,6 +13,6 @@ , nano = require('../../nano')(cfg) | ||
tests.destroy_db_ok = function (e,b) { | ||
assert.isNull(e); | ||
assert.equal(b.ok, true); | ||
this.t.notOk(e); | ||
this.t.equal(b.ok, true); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -18,8 +17,8 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy("db_ge1"); | ||
assert.isNull(e); | ||
assert.equal(b.doc_count,0); | ||
assert.equal(b.doc_del_count,0); | ||
assert.equal(b.db_name,"db_ge1"); | ||
this.t.notOk(e); | ||
this.t.equal(b.doc_count,0); | ||
this.t.equal(b.doc_del_count,0); | ||
this.t.equal(b.db_name,"db_ge1"); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -15,6 +14,6 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy("db_li1"); | ||
assert.isNull(e); | ||
assert.notEqual(b.indexOf("db_li1"),-1); | ||
this.t.notOk(e); | ||
this.t.notEqual(b.indexOf("db_li1"),-1); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -29,7 +28,7 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy("db_re1_replica"); | ||
assert.isNull(e); | ||
assert.equal(b.total_rows, 3); | ||
assert.ok(b.rows); | ||
this.t.notOk(e); | ||
this.t.equal(b.total_rows, 3); | ||
this.t.ok(b.rows); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -23,8 +22,8 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
assert.equal(b.length, "2"); | ||
assert.ok(b[0].id); | ||
assert.ok(b[1].id); | ||
this.t.notOk(e); | ||
this.t.equal(b.length, 2); | ||
this.t.ok(b[0].id); | ||
this.t.ok(b[1].id); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -21,8 +20,8 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy("doc_de1"); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.equal(b.id, "foo"); | ||
assert.ok(b.rev); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.equal(b.id, "foo"); | ||
this.t.ok(b.rev); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -20,6 +19,6 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name('a')); | ||
assert.isNull(e); | ||
assert.ok(b._rev); | ||
assert.equal(b._id, "foo"); | ||
assert.equal(b.foo, "bar"); | ||
this.t.notOk(e); | ||
this.t.ok(b._rev); | ||
this.t.equal(b._id, "foo"); | ||
this.t.equal(b.foo, "bar"); | ||
}; | ||
@@ -39,8 +38,8 @@ | ||
nano.db.destroy(db_name('b')); | ||
assert.isNull(e); | ||
assert.ok(b._revs_info); | ||
assert.equal(b._id, "foo"); | ||
assert.equal(b.foo, "bar"); | ||
this.t.notOk(e); | ||
this.t.ok(b._revs_info); | ||
this.t.equal(b._id, "foo"); | ||
this.t.equal(b.foo, "bar"); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -18,6 +17,6 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name("a")); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.ok(b.rev); | ||
assert.ok(b.id); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.ok(b.rev); | ||
this.t.ok(b.id); | ||
}; | ||
@@ -33,8 +32,8 @@ | ||
nano.db.destroy(db_name("b")); | ||
assert.isNull(e); | ||
assert.ok(b.ok); | ||
assert.ok(b.rev); | ||
assert.equal(b.id, "some/path"); | ||
this.t.notOk(e); | ||
this.t.ok(b.ok); | ||
this.t.ok(b.rev); | ||
this.t.equal(b.id, "some/path"); | ||
} | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -26,5 +25,5 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy(db_name('a')); | ||
assert.isNull(e); | ||
assert.equal(b.total_rows,3); | ||
assert.ok(b.rows); | ||
this.t.notOk(e); | ||
this.t.equal(b.total_rows,3); | ||
this.t.ok(b.rows); | ||
}; | ||
@@ -51,6 +50,6 @@ | ||
nano.db.destroy(db_name('b')); | ||
assert.isNull(e); | ||
assert.equal(b.rows.length,1); | ||
assert.equal(b.total_rows,3); | ||
assert.ok(b.rows); | ||
this.t.notOk(e); | ||
this.t.equal(b.rows.length,1); | ||
this.t.equal(b.total_rows,3); | ||
this.t.ok(b.rows); | ||
}; | ||
@@ -73,8 +72,8 @@ | ||
nano.db.destroy(db_name('c')); | ||
assert.isNull(e); | ||
assert.equal(b.rows.length,2); | ||
assert.equal(b.total_rows,3); | ||
assert.ok(b.rows); | ||
this.t.notOk(e); | ||
this.t.equal(b.rows.length,2); | ||
this.t.equal(b.total_rows,3); | ||
this.t.ok(b.rows); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -20,8 +19,8 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy(db_name('a')); | ||
assert.isNull(e); | ||
assert.equal(b.id, "foo"); | ||
assert.ok(b.ok); | ||
assert.ok(b.rev); | ||
this.t.notOk(e); | ||
this.t.equal(b.id, "foo"); | ||
this.t.ok(b.ok); | ||
this.t.ok(b.rev); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -8,12 +7,12 @@ , nano = require('../../nano') | ||
tests.url = function (callback) { callback(null,nano('http://someurl.com')); }; | ||
tests.url_ok = function (_,n) { assert.equal(n.config.url, "http://someurl.com"); }; | ||
tests.url_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com"); }; | ||
tests.url2 = function (callback) { callback(null,nano('http://someurl.com/')); }; | ||
tests.url2_ok = function (_,n) { assert.equal(n.config.url, "http://someurl.com/"); }; | ||
tests.url2_ok = function (_,n) { this.t.equal(n.config.url, "http://someurl.com/"); }; | ||
tests.url_db = function (callback) { nano(cfg.url + "/adb").info(callback); }; | ||
tests.url_db_ok = function (e,b) { | ||
assert.equal(e.message,"no_db_file"); | ||
assert.equal(e.error, "not_found"); | ||
assert.equal(e.request.uri, (cfg.url + '/adb')); | ||
this.t.equal(e.message,"no_db_file"); | ||
this.t.equal(e.error, "not_found"); | ||
this.t.equal(e.request.uri, (cfg.url + '/adb')); | ||
}; | ||
@@ -23,5 +22,5 @@ | ||
tests.url_db2_ok = function (e,b) { | ||
assert.equal(e.message,"no_db_file"); | ||
assert.equal(e.error, "not_found"); | ||
assert.equal(e.request.uri, (cfg.url + '/acb')); | ||
this.t.equal(e.message,"no_db_file"); | ||
this.t.equal(e.error, "not_found"); | ||
this.t.equal(e.request.uri, (cfg.url + '/acb')); | ||
}; | ||
@@ -31,5 +30,5 @@ | ||
tests.url_db3_ok = function (e,b) { | ||
assert.equal(e.message,"no_db_file"); | ||
assert.equal(e.error, "not_found"); | ||
assert.equal(e.request.uri, (cfg.url + '/adb')); | ||
this.t.equal(e.message,"no_db_file"); | ||
this.t.equal(e.error, "not_found"); | ||
this.t.equal(e.request.uri, (cfg.url + '/adb')); | ||
}; | ||
@@ -39,22 +38,22 @@ | ||
tests.url_db4_ok = function (e,b) { | ||
assert.equal(e.message,"no_db_file"); | ||
assert.equal(e.error, "not_found"); | ||
assert.equal(e.request.uri, (cfg.url + '/a')); | ||
this.t.equal(e.message,"no_db_file"); | ||
this.t.equal(e.error, "not_found"); | ||
this.t.equal(e.request.uri, (cfg.url + '/a')); | ||
}; | ||
tests.file = function (callback) { callback(null,nano(__dirname+ '/../../cfg/tests.js')); }; | ||
tests.file_ok = function (_,n) { assert.equal(n.config.url, cfg.url); }; | ||
tests.file_ok = function (_,n) { this.t.equal(n.config.url, cfg.url); }; | ||
tests.bad_file = function (callback) { callback(null,nano('notafile')); }; | ||
tests.bad_file_ok = function (_,e) { assert.equal(e.config.url,"http://localhost:5984"); }; | ||
tests.bad_file_ok = function (_,e) { this.t.equal(e.config.url,"http://localhost:5984"); }; | ||
tests.obj_cfg = function (callback) { callback(null,nano(cfg)); }; | ||
tests.obj_cfg_ok = function (_,n) { assert.equal(n.config.url, cfg.url); }; | ||
tests.obj_cfg_ok = function (_,n) { this.t.equal(n.config.url, cfg.url); }; | ||
tests.not_string_or_object = function (callback) { callback(null,nano(false)); }; | ||
tests.not_string_or_object_ok = function (_,e) { assert.equal(e.config.url,"http://localhost:5984"); }; | ||
tests.not_string_or_object_ok = function (_,e) { this.t.equal(e.config.url,"http://localhost:5984"); }; | ||
tests.nano_undefined = function (callback) { callback(null,nano()); }; | ||
tests.nano_undefined_ok = function (_,e) { assert.equal(e.config.url,"http://localhost:5984"); }; | ||
tests.nano_undefined_ok = function (_,e) { this.t.equal(e.config.url,"http://localhost:5984"); }; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, err = require('../../error') | ||
@@ -11,6 +10,6 @@ , tests = exports; | ||
tests.empty_error_ok = function (_,e) { | ||
assert.equal(e.message, "Unknown Error"); | ||
assert.equal(e['status-code'], 500); | ||
assert.equal(e.error, "unknown"); | ||
assert.ok(typeof e.request === 'object'); | ||
this.t.equal(e.message, "Unknown Error"); | ||
this.t.equal(e['status-code'], 500); | ||
this.t.equal(e.error, "unknown"); | ||
this.t.ok(typeof e.request === 'object'); | ||
}; | ||
@@ -23,8 +22,8 @@ | ||
tests.error_412_ok = function (_,e) { | ||
assert.equal(e.message, "Precondition Failed"); | ||
assert.equal(e['status-code'], 412); | ||
assert.equal(e.error, "unknown"); | ||
assert.ok(typeof e.request === 'object'); | ||
this.t.equal(e.message, "Precondition Failed"); | ||
this.t.equal(e['status-code'], 412); | ||
this.t.equal(e.error, "unknown"); | ||
this.t.ok(typeof e.request === 'object'); | ||
}; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, nano = require('../../nano') | ||
@@ -7,7 +6,7 @@ , tests = exports; | ||
tests.version = function (callback) { callback(null,nano.version); }; | ||
tests.version_ok = function (_,n) { assert.ok(n); }; | ||
tests.version_ok = function (_,n) { this.t.ok(n); }; | ||
tests.path = function (callback) { callback(null,nano.path); }; | ||
tests.path_ok = function (_,n) { assert.ok(n); }; | ||
tests.path_ok = function (_,n) { this.t.ok(n); }; | ||
ensure(__filename,tests,module,process.argv[2]); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -33,6 +32,6 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy("view_co1"); | ||
assert.isNull(err); | ||
assert.equal(view.total_rows, 2); | ||
this.t.notOk(err); | ||
this.t.equal(view.total_rows, 2); | ||
}; | ||
ensure(__filename, tests, module); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, async = require('async') | ||
@@ -30,8 +29,8 @@ , cfg = require('../../cfg/tests.js') | ||
nano.db.destroy("view_md1"); | ||
assert.isNull(err); | ||
assert.equal(view.rows.length, 2); | ||
assert.equal(view.rows[0].id, 'foo'); | ||
assert.equal(view.rows[1].id, 'bar'); | ||
this.t.notOk(err); | ||
this.t.equal(view.rows.length, 2); | ||
this.t.equal(view.rows[0].id, 'foo'); | ||
this.t.equal(view.rows[1].id, 'bar'); | ||
}; | ||
ensure(__filename, tests, module); |
var ensure = require('ensure') | ||
, assert = require('assert') | ||
, cfg = require('../../cfg/tests.js') | ||
@@ -31,6 +30,6 @@ , nano = require('../../nano')(cfg) | ||
nano.db.destroy("view_qu1"); | ||
assert.isNull(e); | ||
assert.equal(view.total_rows,0); | ||
this.t.notOk(e); | ||
this.t.equal(view.total_rows,0); | ||
}; | ||
ensure(__filename, tests, module); |
Sorry, the diff of this file is not supported yet
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
52927
34
1256