You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ga...@apache.org on 2017/01/11 11:45:48 UTC

[01/15] couchdb-nano git commit: version bump for dependencies

Repository: couchdb-nano
Updated Branches:
  refs/heads/master 596e9d1c6 -> 939c980ac


version bump for dependencies


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/04386c17
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/04386c17
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/04386c17

Branch: refs/heads/master
Commit: 04386c17cdf66233b2c50b42e0bef1f59485d400
Parents: 596e9d1
Author: Glynn Bird <gl...@gmail.com>
Authored: Wed Oct 26 10:51:56 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 10:51:56 2016 +0100

----------------------------------------------------------------------
 package.json | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/04386c17/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 7517baf..3f7c092 100644
--- a/package.json
+++ b/package.json
@@ -17,19 +17,19 @@
     "database"
   ],
   "dependencies": {
-    "request": "^2.53.0",
+    "request": "^2.76.0",
     "follow": "^0.12.1",
-    "errs": "^0.3.0",
-    "underscore": "^1.7.0",
-    "debug": "^2.0.0"
+    "errs": "^0.3.2",
+    "underscore": "^1.8.3",
+    "debug": "^2.2.0"
   },
   "devDependencies": {
-    "async": "^0.9.0",
-    "tape": "^3.0.0",
-    "istanbul": "^0.3.2",
-    "jshint": "^2.5.6",
-    "jscs": "^1.7.0",
-    "nock": "^0.48.1",
+    "async": "^2.1.2",
+    "tape": "^4.6.2",
+    "istanbul": "^0.4.5",
+    "jshint": "^2.9.4",
+    "jscs": "^3.0.7",
+    "nock": "^9.0.0",
     "endswith": "^0.0.0",
     "tape-it": "^0.3.1"
   },


[02/15] couchdb-nano git commit: fix mocked tests

Posted by ga...@apache.org.
fix mocked tests


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/d1c7554c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/d1c7554c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/d1c7554c

Branch: refs/heads/master
Commit: d1c7554c0a9ecbab2c7c4ad3616195d3da9bbbfc
Parents: 04386c1
Author: Glynn Bird <gl...@gmail.com>
Authored: Wed Oct 26 11:54:56 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 11:54:56 2016 +0100

----------------------------------------------------------------------
 lib/nano.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/d1c7554c/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index 9ca5137..be93a5d 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -189,8 +189,11 @@ module.exports = exports = nano = function dbScope(cfg) {
       return httpAgent(req);
     }
 
-    return httpAgent(req, function(e, h, b) {
+    return httpAgent(req, function(e, h, b) { 
       rh = h && h.headers || {};
+      if ( _.isEmpty(rh) ) {
+        rh = h && h.request && h.request.headers || {};
+      }
       rh.statusCode = h && h.statusCode || 500;
       rh.uri = req.uri;
 
@@ -440,8 +443,10 @@ module.exports = exports = nano = function dbScope(cfg) {
           if (e && e.statusCode !== 404) {
             return callback(e);
           }
-          qs.headers.Destination += '?rev=' +
-            h.etag.substring(1, h.etag.length - 1);
+          if (h.etag) {
+            qs.headers.Destination += '?rev=' +
+              h.etag.substring(1, h.etag.length - 1);
+          }
           return relax(qs, callback);
         });
       } else {


[12/15] couchdb-nano git commit: Validate docName parameter to avoid db delete

Posted by ga...@apache.org.
Validate docName parameter to avoid db delete


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/3db2d953
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/3db2d953
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/3db2d953

Branch: refs/heads/master
Commit: 3db2d953b08328d366d10756dbe49874ec8041d5
Parents: a255f68
Author: Rami Alia <ra...@gmail.com>
Authored: Mon Apr 25 13:42:52 2016 -0400
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:37:28 2016 +0100

----------------------------------------------------------------------
 lib/nano.js                           | 18 ++++++++++++------
 tests/integration/document/destroy.js |  8 ++++++++
 2 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/3db2d953/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index 79ea56e..440cdde 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -396,12 +396,18 @@ module.exports = exports = nano = function dbScope(cfg) {
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid
     function destroyDoc(docName, rev, callback) {
-      return relax({
-        db: dbName,
-        doc: docName,
-        method: 'DELETE',
-        qs: {rev: rev}
-      }, callback);
+      if(!docName) {
+        if(callback)
+          callback("Invalid doc id", null);
+      }
+      else {
+        return relax({
+          db: dbName,
+          doc: docName,
+          method: 'DELETE',
+          qs: {rev: rev}
+        }, callback);
+      }
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/3db2d953/tests/integration/document/destroy.js
----------------------------------------------------------------------
diff --git a/tests/integration/document/destroy.js b/tests/integration/document/destroy.js
index 0d6bdf7..7e07448 100644
--- a/tests/integration/document/destroy.js
+++ b/tests/integration/document/destroy.js
@@ -29,6 +29,14 @@ it('should insert a document', function(assert) {
   });
 });
 
+it('should not delete a db', function(assert) {
+  db.destroy(undefined, undefined, function(error, response) {
+    assert.equal(error, 'Invalid doc id', 'validated delete parameters');
+    assert.equal(response, null, 'ok!');
+    assert.end();
+  });
+});
+
 it('should delete a document', function(assert) {
   db.destroy('foobaz', rev, function(error, response) {
     assert.equal(error, null, 'deleted foo');


[14/15] couchdb-nano git commit: modify tests to work mocked and unmocked with CouchDB 2.0 from Docker

Posted by ga...@apache.org.
modify tests to work mocked and unmocked with CouchDB 2.0 from Docker


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/cb870b82
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/cb870b82
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/cb870b82

Branch: refs/heads/master
Commit: cb870b82e352b07e158556bebbea53948107ce43
Parents: 6be3aec
Author: Glynn Bird <gl...@gmail.com>
Authored: Wed Oct 26 15:01:12 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Thu Oct 27 08:33:47 2016 +0100

----------------------------------------------------------------------
 .travis.yml                           |  4 +++-
 lib/nano.js                           |  4 ----
 package.json                          |  3 ++-
 scripts/run_couchdb_on_travis.sh      | 13 +++++++++++++
 tests/fixtures/shared/cookie.json     |  8 ++------
 tests/integration/database/compact.js |  1 -
 tests/integration/database/list.js    |  6 ++++--
 tests/integration/design/compact.js   |  4 ++--
 tests/integration/design/show.js      |  4 +++-
 tests/integration/multipart/get.js    |  6 ++++--
 tests/integration/shared/cookie.js    | 29 ++++++++++++++---------------
 11 files changed, 47 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index c0f8448..0e7bd2c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,8 +14,10 @@ node_js:
   - "4.2"
   - "node"
 services:
-  - couchdb
+  - docker
 os:
   - linux
+before_script:
+  - ./scripts/run_couchdb_on_travis.sh
 before_install:
   - npm update -g npm

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index 440cdde..528e3f5 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -191,12 +191,8 @@ module.exports = exports = nano = function dbScope(cfg) {
 
     return httpAgent(req, function(e, h, b) { 
       rh = h && h.headers || {};
-      if ( _.isEmpty(rh) ) {
-        rh = h && h.request && h.request.headers || {};
-      }
       rh.statusCode = h && h.statusCode || 500;
       rh.uri = req.uri;
-
       if (e) {
         log({err: 'socket', body: b, headers: rh});
         return callback(errs.merge(e, {

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3f7c092..78d8eb9 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,8 @@
     "tape-it": "^0.3.1"
   },
   "scripts": {
-    "test": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js",
+    "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha",
+    "mocha": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js",
     "unmocked": "NOCK_OFF=true tape tests/*/*/*.js",
     "mocked": "tape tests/*/*/*.js",
     "jshint": "jshint tests/*/*/*.js lib/*.js",

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/scripts/run_couchdb_on_travis.sh
----------------------------------------------------------------------
diff --git a/scripts/run_couchdb_on_travis.sh b/scripts/run_couchdb_on_travis.sh
new file mode 100755
index 0000000..fa7a30c
--- /dev/null
+++ b/scripts/run_couchdb_on_travis.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+if [ ! -z $TRAVIS ]; then
+	# Install CouchDB Master
+	docker run --ulimit nofile=2048:2048 -d -p 5984:5984 klaemo/couchdb:2.0-dev@sha256:336fd3d9a89475205fc79b6a287ee550d258fac3b62c67b8d13b8e66c71d228f --with-haproxy \
+	    --with-admin-party-please -n 1
+
+	# wait for couchdb to start
+	while [ '200' != $(curl -s -o /dev/null -w %{http_code} http://127.0.0.1:5984) ]; do
+	  echo waiting for couch to load... ;
+	  sleep 1;
+	done
+fi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/fixtures/shared/cookie.json
----------------------------------------------------------------------
diff --git a/tests/fixtures/shared/cookie.json b/tests/fixtures/shared/cookie.json
index fef043c..c1b9d48 100644
--- a/tests/fixtures/shared/cookie.json
+++ b/tests/fixtures/shared/cookie.json
@@ -4,8 +4,8 @@
   , "status"   : 201
   , "response" : "{ \"ok\": true }"
   }
-, { "path"     : "/_config/admins/admin"
-  , "method"   : "put"
+, { "path"     : "/_users"
+  , "method"   : "post"
   , "body"     : "*"
   , "response" : "{\"ok\": true}"
   }
@@ -28,10 +28,6 @@
   , "body"     : "{\"foo\":\"baz\"}"
   , "response" : "{\"ok\":true,\"id\":\"234\",\"rev\":\"1-333231\"}"
   }
-, { "path"     : "/_config/admins/admin"
-  , "method"   : "delete"
-  , "response" : "{\"ok\": true}"
-  }
 , { "method"   : "delete"
   , "path"     : "/shared_cookie"
   , "response" : "{ \"ok\": true }"

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/database/compact.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/compact.js b/tests/integration/database/compact.js
index 98c9468..9db90fe 100644
--- a/tests/integration/database/compact.js
+++ b/tests/integration/database/compact.js
@@ -36,7 +36,6 @@ it('should have run the compaction', function(assert) {
       assert.equal(error, null, 'info should respond');
       assert.equal(info['doc_count'], 0, 'document count is not 3');
       assert.equal(info['doc_del_count'], 1, 'document should be deleted');
-      assert.equal(info['update_seq'][0], '2', 'seq is two');
       assert.end();
     });
   });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/database/list.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/list.js b/tests/integration/database/list.js
index 8759a75..f30159c 100644
--- a/tests/integration/database/list.js
+++ b/tests/integration/database/list.js
@@ -19,8 +19,10 @@ var nano = harness.locals.nano;
 
 it('should ensure _replicator and _users are created', function(assert) {
   nano.db.create('_replicator', function() {
-    nano.db.create('_users', function() {
-      assert.end();
+    nano.db.destroy('_users', function() {
+      nano.db.create('_users', function() {
+        assert.end();
+      });
     });
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/design/compact.js
----------------------------------------------------------------------
diff --git a/tests/integration/design/compact.js b/tests/integration/design/compact.js
index 610bb14..9628dba 100644
--- a/tests/integration/design/compact.js
+++ b/tests/integration/design/compact.js
@@ -41,7 +41,7 @@ it('should insert `alice` the design doc', function(assert) {
   });
 });
 
-it('should be able to compact a view', function(assert) {
+/*it('should be able to compact a view', function(assert) {
   async.waterfall([
     function(next) {
       db.view.compact('alice', next);
@@ -65,4 +65,4 @@ it('should be able to compact a view', function(assert) {
     assert.equal(view['total_rows'], 0, 'and see stuff got deleted');
     assert.end();
   });
-});
+});*/

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/design/show.js
----------------------------------------------------------------------
diff --git a/tests/integration/design/show.js b/tests/integration/design/show.js
index 2d6f20d..87177bc 100644
--- a/tests/integration/design/show.js
+++ b/tests/integration/design/show.js
@@ -87,7 +87,9 @@ it('should show the amazing clemens in html', function(assert) {
   db.show('people', 'singleDoc', 'p_clemens', {format: 'html'},
   function(error, doc, rh) {
     assert.equal(error, null, 'should work');
-    assert.equal(rh['content-type'], 'text/html');
+    if (helpers.unmocked) {
+      assert.equal(rh['content-type'], 'text/html');
+    }
     assert.equal(doc, 'Hello Clemens!');
     assert.end();
   });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/multipart/get.js
----------------------------------------------------------------------
diff --git a/tests/integration/multipart/get.js b/tests/integration/multipart/get.js
index 67661f5..7918663 100644
--- a/tests/integration/multipart/get.js
+++ b/tests/integration/multipart/get.js
@@ -39,8 +39,10 @@ it('should be able to insert a doc with att', function(assert) {
 it('should be able to get the document with the attachment', function(assert) {
   db.multipart.get('foobaz', function(error, foobaz, headers) {
     assert.equal(error, null, 'should get foobaz');
-    assert.ok(headers['content-type'], 'should have content type');
-    assert.equal(headers['content-type'].split(';')[0], 'multipart/related');
+    if (helpers.unmocked) {
+      assert.ok(headers['content-type'], 'should have content type');
+      assert.equal(headers['content-type'].split(';')[0], 'multipart/related');
+    }
     assert.equal(typeof foobaz, 'object', 'foobaz should be a buffer');
     assert.end();
   });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/cb870b82/tests/integration/shared/cookie.js
----------------------------------------------------------------------
diff --git a/tests/integration/shared/cookie.js b/tests/integration/shared/cookie.js
index 0c42e90..3c5cde1 100644
--- a/tests/integration/shared/cookie.js
+++ b/tests/integration/shared/cookie.js
@@ -22,17 +22,25 @@ var admin = Nano(helpers.admin);
 var cookie;
 var server;
 
-it('should be able to setup admin and login', function(assert) {
+it('should be able to create a user', function(assert) {
   nano.relax({
-    method : 'PUT',
-    path: '_node/couchdb@localhost/_config/admins/' + helpers.username,
-    body: helpers.password
+    method : 'POST',
+    path: '_users',
+    body: {
+      _id: 'org.couchdb.user:' + helpers.username,
+      type: 'user',
+      name: helpers.username,
+      roles: ['admin'],
+      password: helpers.password
+    }
   }, function(err) {
     assert.equal(err, null, 'should create admin');
     nano.auth(helpers.username, helpers.password, function(err, _, headers) {
       assert.equal(err, null, 'should have logged in successfully');
-      assert.ok(headers['set-cookie'],
-        'response should have a set-cookie header');
+      if (helpers.unmocked) {
+        assert.ok(headers['set-cookie'],
+          'response should have a set-cookie header');
+      }
       cookie = headers['set-cookie'];
       assert.end();
     });
@@ -62,12 +70,3 @@ it('should be able to get the session', function(assert) {
   });
 });
 
-it('must restore admin parteh mode for other tests', function(assert) {
-  admin.relax({
-    method: 'DELETE',
-    path: '_node/couchdb@localhost/_config/admins/' + helpers.username
-  }, function(err) {
-    assert.equal(err, null, 'should have deleted admin user');
-    assert.end();
-  });
-});


[10/15] couchdb-nano git commit: ct: Allow body to be optional in db.atomic.

Posted by ga...@apache.org.
ct: Allow body to be optional in db.atomic.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/6b5d7238
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/6b5d7238
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/6b5d7238

Branch: refs/heads/master
Commit: 6b5d72388030f4ab095995307cc7df684446a67a
Parents: f757cdd
Author: Chris Taylor <ct...@gmail.com>
Authored: Sat Apr 23 00:54:54 2016 -0400
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:36:24 2016 +0100

----------------------------------------------------------------------
 lib/nano.js | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/6b5d7238/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index cf6f709..79ea56e 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -562,6 +562,10 @@ module.exports = exports = nano = function dbScope(cfg) {
 
     // http://docs.couchdb.org/en/latest/api/ddoc/render.html#put--db-_design-ddoc-_update-func-docid
     function updateWithHandler(ddoc, viewName, docName, body, callback) {
+      if (typeof body === 'function') {
+          callback = body;
+          body = undefined;
+      }
       return view(ddoc, viewName + '/' + encodeURIComponent(docName), {
         type: 'update',
         method: 'PUT',


[09/15] couchdb-nano git commit: ct: Test for optional body in db.atomic

Posted by ga...@apache.org.
ct: Test for optional body in db.atomic


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/f757cdd6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/f757cdd6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/f757cdd6

Branch: refs/heads/master
Commit: f757cdd6c29d95fc74ae00b00dd74afcc54b6e9c
Parents: 118e209
Author: Chris Taylor <ct...@gmail.com>
Authored: Sat Apr 23 00:52:50 2016 -0400
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:36:16 2016 +0100

----------------------------------------------------------------------
 tests/integration/design/atomic.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/f757cdd6/tests/integration/design/atomic.js
----------------------------------------------------------------------
diff --git a/tests/integration/design/atomic.js b/tests/integration/design/atomic.js
index 8fedaf1..f948387 100644
--- a/tests/integration/design/atomic.js
+++ b/tests/integration/design/atomic.js
@@ -26,6 +26,10 @@ it('should be able to insert an atomic design doc', function(assert) {
         var body = JSON.parse(req.body);
         doc[body.field] = body.value;
         return [doc, JSON.stringify(doc)];
+      },
+      addbaz: function (doc, req) {
+        doc.baz = "biz";
+        return [doc, JSON.stringify(doc)];
       }
     }
   }, '_design/update', function(err) {
@@ -51,6 +55,16 @@ it('should be able to insert atomically', function(assert) {
   });
 });
 
+it('should be able to update atomically without a body', function (assert) {
+  db.insert({}, 'baz', function (error, doc) {
+    db.atomic('update', 'addbaz', 'baz', function (error, response) {
+      assert.equal(error, null, 'should be able to update');
+      assert.equal(response.baz, 'biz', 'and the new field is present');
+      assert.end();
+    });
+  });
+});
+
 it('should be able to update with slashes on the id', function(assert) {
   db.insert({'wat': 'wat'}, 'wat/wat', function(error, foo) {
     assert.equal(error, null, 'stores `wat`');


[03/15] couchdb-nano git commit: modified tests to work with latest dependencies and CouchDB 2.0

Posted by ga...@apache.org.
modified tests to work with latest dependencies and CouchDB 2.0


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/45d58bfe
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/45d58bfe
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/45d58bfe

Branch: refs/heads/master
Commit: 45d58bfeb8b59ee97d1821ed9006c735fc65f4e4
Parents: d1c7554
Author: Glynn Bird <gl...@gmail.com>
Authored: Wed Oct 26 14:19:25 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:19:25 2016 +0100

----------------------------------------------------------------------
 tests/fixtures/database/changes.json            |  4 +-
 tests/fixtures/shared/error.json                |  2 +-
 tests/helpers/integration.js                    |  4 +-
 tests/integration/database/changes.js           |  7 +--
 tests/integration/database/compact.js           |  2 +-
 .../integration/database/create-and-destroy.js  |  2 +-
 tests/integration/database/follow.js            | 16 ++----
 tests/integration/database/list.js              |  8 +++
 tests/integration/database/replicate.js         |  4 +-
 tests/integration/design/show.js                |  2 +-
 tests/integration/shared/cookie.js              |  4 +-
 tests/integration/shared/error.js               |  2 +-
 tests/integration/shared/updates.js             | 60 --------------------
 13 files changed, 29 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/fixtures/database/changes.json
----------------------------------------------------------------------
diff --git a/tests/fixtures/database/changes.json b/tests/fixtures/database/changes.json
index 820d2fe..7bce048 100644
--- a/tests/fixtures/database/changes.json
+++ b/tests/fixtures/database/changes.json
@@ -23,8 +23,8 @@
   , "response" : "{\"ok\":true,\"id\":\"barfoo\",\"rev\":\"1-3cde10\"}"
   }
 , { "status"   : 200
-  , "path"     : "/database_changes/_changes?since=2"
-  , "response" : "{\"results\":[\n{\"seq\":3,\"id\":\"foobaz\",\"changes\":[{\"rev\":\"1-cfa20dddac397da5bf0be2b50fb472fe\"}]}\n],\n\"last_seq\":3}"
+  , "path"     : "/database_changes/_changes?since=0"
+  , "response" : "{\"results\":[{\"seq\":\"1-abc\",\"id\":\"a\",\"changes\":[{\"rev\":\"1-abc\"}]},{\"seq\":\"2-abc\",\"id\":\"b\",\"changes\":[{\"rev\":\"1-abc\"}]},{\"seq\":\"3-abc\",\"id\":\"c\",\"changes\":[{\"rev\":\"1-abc\"}]}],\"last_seq\":\"3-abc\"}"
   }
 , { "method"   : "delete"
   , "path"     : "/database_changes"

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/fixtures/shared/error.json
----------------------------------------------------------------------
diff --git a/tests/fixtures/shared/error.json b/tests/fixtures/shared/error.json
index 4b42be2..4210c2c 100644
--- a/tests/fixtures/shared/error.json
+++ b/tests/fixtures/shared/error.json
@@ -10,7 +10,7 @@
 , { "method"   : "delete"
   , "path"     : "/say_wat_wat"
   , "status"   : 404
-  , "response" : "{\"error\":\"not_found\",\"reason\":\"missing\"}"
+  , "response" : "{\"error\":\"not_found\",\"reason\":\"Database does not exist.\"}"
   }
 , { "method"   : "delete"
   , "path"     : "/shared_error"

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/helpers/integration.js
----------------------------------------------------------------------
diff --git a/tests/helpers/integration.js b/tests/helpers/integration.js
index f7b3249..c63c4ea 100644
--- a/tests/helpers/integration.js
+++ b/tests/helpers/integration.js
@@ -146,7 +146,7 @@ helpers.prepareAView = function(assert, search, db) {
         }, 'p_nuno', cb);
       }
     ], function(error) {
-      assert.equal(error, undefined, 'store the peeps');
+      assert.equal(error, null, 'store the peeps');
       assert.end();
     });
   });
@@ -180,7 +180,7 @@ helpers.insertThree = function insertThree(assert) {
     function(cb) { db.insert({'bar': 'foo'}, 'barfoo', cb); },
     function(cb) { db.insert({'foo': 'baz'}, 'foobaz', cb); }
   ], function(error) {
-    assert.equal(error, undefined, 'should store docs');
+    assert.equal(error, null, 'should store docs');
     assert.end();
   });
 };

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/changes.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/changes.js b/tests/integration/database/changes.js
index d8f251a..8c96f43 100644
--- a/tests/integration/database/changes.js
+++ b/tests/integration/database/changes.js
@@ -19,11 +19,10 @@ var it = harness.it;
 
 it('should be able to insert three documents', helpers.insertThree);
 
-it('should be able to receive changes since seq:2', function(assert) {
-  db.changes({since:2}, function(error, response) {
+it('should be able to receive changes since seq:0', function(assert) {
+  db.changes({since:0}, function(error, response) {
     assert.equal(error, null, 'gets response from changes');
-    assert.equal(response.results.length, 1, 'gets one result');
-    assert.equal(response['last_seq'], 3, 'seq is 3');
+    assert.equal(response.results.length, 3, 'gets three results');
     assert.end();
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/compact.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/compact.js b/tests/integration/database/compact.js
index 0eef721..98c9468 100644
--- a/tests/integration/database/compact.js
+++ b/tests/integration/database/compact.js
@@ -36,7 +36,7 @@ it('should have run the compaction', function(assert) {
       assert.equal(error, null, 'info should respond');
       assert.equal(info['doc_count'], 0, 'document count is not 3');
       assert.equal(info['doc_del_count'], 1, 'document should be deleted');
-      assert.equal(info['update_seq'], 2, 'seq is two');
+      assert.equal(info['update_seq'][0], '2', 'seq is two');
       assert.end();
     });
   });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/create-and-destroy.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/create-and-destroy.js b/tests/integration/database/create-and-destroy.js
index 952c9ee..94d082b 100644
--- a/tests/integration/database/create-and-destroy.js
+++ b/tests/integration/database/create-and-destroy.js
@@ -37,7 +37,7 @@ function(assert) {
 
 it('must destroy the databases we created', function(assert) {
   async.forEach(['az09_$()+-/', 'with/slash'], nano.db.destroy, function(err) {
-    assert.equal(err, undefined, 'should destroy all dbs');
+    assert.equal(err, null, 'should destroy all dbs');
     assert.end();
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/follow.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/follow.js b/tests/integration/database/follow.js
index a4bcdaf..e66749c 100644
--- a/tests/integration/database/follow.js
+++ b/tests/integration/database/follow.js
@@ -25,14 +25,13 @@ if (helpers.unmocked) {
   it('should be able to get the changes feed', function(assert) {
     var i = 3;
 
-    feed1 = db.follow({since: 3});
+    feed1 = db.follow({since: '0'});
 
     feed1.on('change', function(change) {
       assert.ok(change, 'change existed');
-      assert.equal(change.seq, i + 1, 'seq is set correctly');
+      //assert.equal(change.seq, i + 1, 'seq is set correctly');
       ++i;
       if (i === 4) {
-        console.log(change, i);
         assert.end();
       }
     });
@@ -44,13 +43,8 @@ if (helpers.unmocked) {
     }, 100);
   });
 
-  it('should see changes since `seq:3`', function(assert) {
-    var feed = db.follow({since: 3}, function(error, change) {
-      assert.equal(error, null, 'should not have errors');
-      assert.ok(change, 'change existed');
-      feed.die();
-      feed1.die();
-      process.nextTick(assert.end);
-    });
+  it('should clear changes feed', function(assert) {
+    feed1.die();
+    assert.end();
   });
 }

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/list.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/list.js b/tests/integration/database/list.js
index 44501b0..8759a75 100644
--- a/tests/integration/database/list.js
+++ b/tests/integration/database/list.js
@@ -17,6 +17,14 @@ var harness = helpers.harness(__filename);
 var it = harness.it;
 var nano = harness.locals.nano;
 
+it('should ensure _replicator and _users are created', function(assert) {
+  nano.db.create('_replicator', function() {
+    nano.db.create('_users', function() {
+      assert.end();
+    });
+  });
+});
+
 it('should list the correct databases', function(assert) {
   nano.db.list(function(error, list) {
     assert.equal(error, null, 'should list databases');

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/database/replicate.js
----------------------------------------------------------------------
diff --git a/tests/integration/database/replicate.js b/tests/integration/database/replicate.js
index ab22ba9..3be79a0 100644
--- a/tests/integration/database/replicate.js
+++ b/tests/integration/database/replicate.js
@@ -27,7 +27,7 @@ it('should insert a bunch of items', helpers.insertThree);
 it('creates a bunch of database replicas', function(assert) {
   async.forEach(['database_replica', 'database_replica2'],
   nano.db.create, function(error) {
-    assert.equal(error, undefined, 'created database(s)');
+    assert.equal(error, null, 'created database(s)');
     assert.end();
   });
 });
@@ -68,7 +68,7 @@ it('should be able to replicate with params', function(assert) {
 it('should destroy the extra databases', function(assert) {
   async.forEach(['database_replica', 'database_replica2'],
   nano.db.destroy, function(error) {
-    assert.equal(error, undefined, 'deleted databases');
+    assert.equal(error, null, 'deleted databases');
     assert.end();
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/design/show.js
----------------------------------------------------------------------
diff --git a/tests/integration/design/show.js b/tests/integration/design/show.js
index 086a03e..2d6f20d 100644
--- a/tests/integration/design/show.js
+++ b/tests/integration/design/show.js
@@ -66,7 +66,7 @@ it('should insert a show ddoc', function(assert) {
           }, 'p_nuno', cb);
         }
       ], function(error) {
-        assert.equal(error, undefined, 'stores docs');
+        assert.equal(error, null, 'stores docs');
         assert.end();
       });
     });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/shared/cookie.js
----------------------------------------------------------------------
diff --git a/tests/integration/shared/cookie.js b/tests/integration/shared/cookie.js
index 9a0eb2a..0c42e90 100644
--- a/tests/integration/shared/cookie.js
+++ b/tests/integration/shared/cookie.js
@@ -25,7 +25,7 @@ var server;
 it('should be able to setup admin and login', function(assert) {
   nano.relax({
     method : 'PUT',
-    path: '_config/admins/' + helpers.username,
+    path: '_node/couchdb@localhost/_config/admins/' + helpers.username,
     body: helpers.password
   }, function(err) {
     assert.equal(err, null, 'should create admin');
@@ -65,7 +65,7 @@ it('should be able to get the session', function(assert) {
 it('must restore admin parteh mode for other tests', function(assert) {
   admin.relax({
     method: 'DELETE',
-    path: '_config/admins/' + helpers.username
+    path: '_node/couchdb@localhost/_config/admins/' + helpers.username
   }, function(err) {
     assert.equal(err, null, 'should have deleted admin user');
     assert.end();

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/shared/error.js
----------------------------------------------------------------------
diff --git a/tests/integration/shared/error.js b/tests/integration/shared/error.js
index ec3a1d0..e9b89de 100644
--- a/tests/integration/shared/error.js
+++ b/tests/integration/shared/error.js
@@ -46,7 +46,7 @@ it('should error when destroying a db that does not exist', function(assert) {
   nano.db.destroy('say_wat_wat', function(error) {
     assert.ok(error, 'an error');
     assert.ok(error.message, 'a note');
-    assert.equal(error.message, 'missing', 'is missing');
+    assert.equal(error.message, 'Database does not exist.', 'is missing');
     assert.end();
   });
 });

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/45d58bfe/tests/integration/shared/updates.js
----------------------------------------------------------------------
diff --git a/tests/integration/shared/updates.js b/tests/integration/shared/updates.js
deleted file mode 100644
index d61abd7..0000000
--- a/tests/integration/shared/updates.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed under the Apache License, Version 2.0 (the 'License'); you may not
-// use this file except in compliance with the License. You may obtain a copy of
-// the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-
-'use strict';
-
-var helpers = require('../../helpers/integration');
-var harness = helpers.harness(__filename, helpers.noopTest, helpers.noopTest);
-var it = harness.it;
-var nano = harness.locals.nano;
-
-it('should be able to track updates in couch', function(assert) {
-  var called = false;
-
-  function getUpdates() {
-    nano.updates(function(err, updates) {
-      if (called) {
-        return;
-      }
-      called = true;
-
-      if (err && updates.error && updates.error === 'illegal_database_name') {
-        //
-        // older couches
-        //
-        assert.expect(1);
-        assert.ok(updates.ok, 'db updates are not supported');
-        assert.end();
-      } else {
-        //
-        // new couches
-        //
-        assert.equal(err, null, 'got root');
-        assert.ok(updates.ok, 'updates are ok');
-        assert.equal(updates.type, 'created', 'update was a create');
-        assert.equal(updates['db_name'], 'mydb', 'mydb was updated');
-        assert.end();
-      }
-    });
-
-    setTimeout(function() { nano.db.create('mydb'); }, 50);
-  }
-
-  nano.db.destroy('mydb', getUpdates);
-});
-
-it('should destroy mydb', function(assert) {
-  nano.db.destroy('mydb', function(err) {
-    assert.equal(err, null, 'no errors');
-    assert.end();
-  });
-});


[08/15] couchdb-nano git commit: Ensure fetch params is optional, fixes #319.

Posted by ga...@apache.org.
Ensure fetch params is optional, fixes #319.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/118e2098
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/118e2098
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/118e2098

Branch: refs/heads/master
Commit: 118e2098b93f77fae4b2daf2070d3e2735a3b095
Parents: 93db52d
Author: Andr� Cruz <an...@msn.com>
Authored: Sat Mar 26 22:03:43 2016 +0000
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:35:11 2016 +0100

----------------------------------------------------------------------
 lib/nano.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/118e2098/lib/nano.js
----------------------------------------------------------------------
diff --git a/lib/nano.js b/lib/nano.js
index be93a5d..cf6f709 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -60,7 +60,7 @@ module.exports = exports = nano = function dbScope(cfg) {
       return db;
     }
   }
-  
+
   function scrub(str) {
     if (str) {
       str = str.replace(/\/\/(.*)@/,"//XXXXXX:XXXXXX@");
@@ -471,6 +471,7 @@ module.exports = exports = nano = function dbScope(cfg) {
         qs = {};
       }
 
+      qs = qs || {};
       qs['include_docs'] = true;
 
       return relax({


[06/15] couchdb-nano git commit: Update README.md

Posted by ga...@apache.org.
Update README.md

Change `cloudant.use` to `nano.use`.

Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/4aac5630
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/4aac5630
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/4aac5630

Branch: refs/heads/master
Commit: 4aac56301bc873856b3c14be9d4c31237500184a
Parents: 3a5a758
Author: Brian Delahunty <br...@briandela.com>
Authored: Tue Feb 9 14:54:39 2016 -0800
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:30:47 2016 +0100

----------------------------------------------------------------------
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/4aac5630/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8ca9dd3..90c10bb 100644
--- a/README.md
+++ b/README.md
@@ -411,7 +411,7 @@ alice.insert({ crazy: true }, 'rabbit', function(err, body) {
 The `insert` function can also be used with the method signature `db.insert(doc,[callback])`, where the `doc` contains the `_id` field e.g.
 
 ~~~ js
-var alice = cloudant.use('alice')
+var alice = nano.use('alice')
 alice.insert({ _id: 'myid', crazy: true }, function(err, body) {
   if (!err)
     console.log(body)
@@ -421,7 +421,7 @@ alice.insert({ _id: 'myid', crazy: true }, function(err, body) {
 and also used to update an existing document, by including the `_rev` token in the document being saved:
 
 ~~~ js
-var alice = cloudant.use('alice')
+var alice = nano.use('alice')
 alice.insert({ _id: 'myid', _rev: '1-23202479633c2b380f79507a776743d5', crazy: false }, function(err, body) {
   if (!err)
     console.log(body)


[04/15] couchdb-nano git commit: Test with 4.2 (LTS) and 5.5 (Stable)

Posted by ga...@apache.org.
Test with 4.2 (LTS) and 5.5 (Stable)


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/225f1519
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/225f1519
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/225f1519

Branch: refs/heads/master
Commit: 225f15199680c708c7f87c9830864d5e3dc795ef
Parents: 45d58bf
Author: Pedro Narciso Garc�a Revington <p....@gmail.com>
Authored: Mon Jan 25 13:08:57 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:29:26 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/225f1519/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 7de7b97..b4e876a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,6 +11,8 @@ node_js:
   - "0.11"
   - "0.12"
   - "iojs"
+  - "4.2"
+  - "node"
 services:
   - couchdb
 os:


[07/15] couchdb-nano git commit: Add db.info doc.

Posted by ga...@apache.org.
Add db.info doc.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/93db52dc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/93db52dc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/93db52dc

Branch: refs/heads/master
Commit: 93db52dc167c2a36d53f8fa2057189dc6a486bb6
Parents: 4aac563
Author: Andr� Cruz <an...@msn.com>
Authored: Fri Feb 26 23:48:52 2016 +0000
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:32:13 2016 +0100

----------------------------------------------------------------------
 README.md | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/93db52dc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 90c10bb..3bfbe57 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,7 @@ minimalistic couchdb driver for node.js
   - [nano.db.replicate(source, target, [opts], [callback])](#nanodbreplicatesource-target-opts-callback)
   - [nano.db.changes(name, [params], [callback])](#nanodbchangesname-params-callback)
   - [nano.db.follow(name, [params], [callback])](#nanodbfollowname-params-callback)
+  - [nano.db.info([callback])](#nanodbinfocallback)
   - [nano.use(name)](#nanousename)
   - [nano.request(opts, [callback])](#nanorequestopts-callback)
   - [nano.config](#nanoconfig)
@@ -300,6 +301,16 @@ process.nextTick(function () {
 });
 ```
 
+### nano.db.info([callback])
+
+gets database information.
+
+nano.db.info(function(err, body) {
+  if (!err) {
+    console.log('got database info'', body);
+  }
+});
+
 ### nano.use(name)
 
 creates a scope where you operate inside `name`.


[15/15] couchdb-nano git commit: ensure CouchDB 2.0 Docker is stopped after each test run

Posted by ga...@apache.org.
ensure CouchDB 2.0 Docker is stopped after each test run


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/939c980a
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/939c980a
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/939c980a

Branch: refs/heads/master
Commit: 939c980acb335a04142018d713251b9ea3186780
Parents: cb870b8
Author: Glynn Bird <gl...@gmail.com>
Authored: Thu Oct 27 08:47:06 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Thu Oct 27 08:47:06 2016 +0100

----------------------------------------------------------------------
 package.json                      | 2 +-
 scripts/run_couchdb_on_travis.sh  | 1 +
 scripts/stop_couchdb_on_travis.sh | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 78d8eb9..9f8fdfe 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
     "tape-it": "^0.3.1"
   },
   "scripts": {
-    "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha",
+    "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha; bash scripts/stop_couchdb_on_travis.sh",
     "mocha": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js",
     "unmocked": "NOCK_OFF=true tape tests/*/*/*.js",
     "mocked": "tape tests/*/*/*.js",

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/scripts/run_couchdb_on_travis.sh
----------------------------------------------------------------------
diff --git a/scripts/run_couchdb_on_travis.sh b/scripts/run_couchdb_on_travis.sh
index fa7a30c..193a60e 100755
--- a/scripts/run_couchdb_on_travis.sh
+++ b/scripts/run_couchdb_on_travis.sh
@@ -2,6 +2,7 @@
 
 if [ ! -z $TRAVIS ]; then
 	# Install CouchDB Master
+	echo "Starting CouchDB 2.0 Docker"
 	docker run --ulimit nofile=2048:2048 -d -p 5984:5984 klaemo/couchdb:2.0-dev@sha256:336fd3d9a89475205fc79b6a287ee550d258fac3b62c67b8d13b8e66c71d228f --with-haproxy \
 	    --with-admin-party-please -n 1
 

http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/939c980a/scripts/stop_couchdb_on_travis.sh
----------------------------------------------------------------------
diff --git a/scripts/stop_couchdb_on_travis.sh b/scripts/stop_couchdb_on_travis.sh
new file mode 100755
index 0000000..4f80bce
--- /dev/null
+++ b/scripts/stop_couchdb_on_travis.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+if [ ! -z $TRAVIS ]; then
+  echo "Stopping CouchDB 2.0 Docker"
+  docker stop $(docker ps -a -q)
+  docker rm $(docker ps -a -q)
+fi
\ No newline at end of file


[13/15] couchdb-nano git commit: Update express.js example for nano 6 and express 4

Posted by ga...@apache.org.
Update express.js example for nano 6 and express 4

There were a few places where this file was out of date.

Express 4:
* express.createServer() has been deprecated
* passing the status via send() has been deprecated
* convention is to use 'req' and 'res' instead of 
  'request' and 'response'  

Nano 6:
* error['status-code'] is now error.statusCode

Also there was a syntax error (too many curly braces).

Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/6be3aec6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/6be3aec6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/6be3aec6

Branch: refs/heads/master
Commit: 6be3aec6dad6f035139bf38e58d39f4e38a8955a
Parents: 3db2d95
Author: phil manijak <gi...@exclsr.com>
Authored: Mon May 9 00:37:41 2016 -0700
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:38:01 2016 +0100

----------------------------------------------------------------------
 examples/express.js | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/6be3aec6/examples/express.js
----------------------------------------------------------------------
diff --git a/examples/express.js b/examples/express.js
index 51dceac..b49ba1d 100644
--- a/examples/express.js
+++ b/examples/express.js
@@ -12,16 +12,19 @@
 
 var express = require('express')
    , db    = require('nano')('http://localhost:5984/my_couch')
-   , app     = module.exports = express.createServer()
+   , app     = module.exports = express()
    ;
 
-app.get('/', function(request,response) {
-    db.get('foo', function (error, body, headers) {
-      if(error) { return response.send(error.message, error['status-code']); }
-      response.send(body, 200);
-    });
-  });
+app.get('/', function(req, res) {
+   db.get('foo', function (error, body, headers) {
+      if(error) {
+         res.status(error.statusCode);
+         return res.send(error.message); 
+      }
+      res.status(200);
+      res.send(body);
+   });
 });
 
 app.listen(3333);
-console.log('server is running. check expressjs.org for more cool tricks');
+console.log('server is running. check expressjs.com for more cool tricks');


[11/15] couchdb-nano git commit: ct: Fix mocks.

Posted by ga...@apache.org.
ct: Fix mocks.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/a255f681
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/a255f681
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/a255f681

Branch: refs/heads/master
Commit: a255f681694f3b2f649660a0caa5891b6ca21712
Parents: 6b5d723
Author: Chris Taylor <ct...@gmail.com>
Authored: Sat Apr 23 01:09:05 2016 -0400
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:36:46 2016 +0100

----------------------------------------------------------------------
 tests/fixtures/design/atomic.json | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/a255f681/tests/fixtures/design/atomic.json
----------------------------------------------------------------------
diff --git a/tests/fixtures/design/atomic.json b/tests/fixtures/design/atomic.json
index 5a58b91..5712da0 100644
--- a/tests/fixtures/design/atomic.json
+++ b/tests/fixtures/design/atomic.json
@@ -22,6 +22,10 @@
   , "response" : "{\"foo\": \"bar\"}"
   }
 , { "method"   : "put"
+  , "path"     : "/design_atomic/_design/update/_update/addbaz/baz"
+  , "response" : "{\"baz\": \"biz\"}"
+  }
+, { "method"   : "put"
   , "status"   : 201
   , "path"     : "/design_atomic/wat%2Fwat"
   , "body"     : "{\"wat\":\"wat\"}"


[05/15] couchdb-nano git commit: removed the osx target since it is not supported by travis

Posted by ga...@apache.org.
removed the osx target since it is not supported by travis


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nano/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nano/commit/3a5a7584
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nano/tree/3a5a7584
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nano/diff/3a5a7584

Branch: refs/heads/master
Commit: 3a5a75846fc7b2f29ceb80d8be27513e0e7e062a
Parents: 225f151
Author: Pedro Narciso Garc�a Revington <p....@gmail.com>
Authored: Thu Jan 28 11:31:47 2016 +0100
Committer: Glynn Bird <gl...@gmail.com>
Committed: Wed Oct 26 14:29:49 2016 +0100

----------------------------------------------------------------------
 .travis.yml | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nano/blob/3a5a7584/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index b4e876a..c0f8448 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,6 +17,5 @@ services:
   - couchdb
 os:
   - linux
-  - osx
 before_install:
   - npm update -g npm