couchdb-worker
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -12,3 +12,3 @@ /* | ||
var request = require("request"); | ||
var extend = require("node.extend"); | ||
var _ = require("underscore"); | ||
@@ -225,3 +225,3 @@ module.exports = Worker; | ||
extend(doc.worker_status[this.name], status); | ||
_.extend(doc.worker_status[this.name], status); | ||
}; | ||
@@ -300,5 +300,4 @@ | ||
// FIXME: do not overwrite nesteds! | ||
// (write custom extend) | ||
extend(doc, attributes); | ||
// maybe FIXME (check if still valid): do not overwrite nesteds! | ||
_.extend(doc, attributes); | ||
}; | ||
@@ -305,0 +304,0 @@ |
@@ -9,7 +9,6 @@ { | ||
}, | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"dependencies": { | ||
"request": "*", | ||
"underscore": "*", | ||
"node.extend": ">=1.0.0" | ||
"underscore": "*" | ||
}, | ||
@@ -16,0 +15,0 @@ "devDependencies": { |
@@ -130,33 +130,11 @@ /* | ||
it("should insert status", function() { | ||
var status = 'mystatus', | ||
error = 'myerror', | ||
var status = { foo: 'bar' }, | ||
doc = {}; | ||
worker._setWorkerStatus(doc, status, error); | ||
worker._setWorkerStatus(doc, status); | ||
assert.equal('object', typeof doc.worker_status); | ||
assert.equal('object', typeof doc.worker_status[worker.name]); | ||
assert.equal(status, doc.worker_status[worker.name].status); | ||
assert.equal(error, doc.worker_status[worker.name].error); | ||
assert.equal(status.foo, doc.worker_status[worker.name].foo); | ||
}); | ||
it("should not insert error if error is null", function() { | ||
var doc = {}; | ||
worker._setWorkerStatus(doc, 'mystatus', null); | ||
assert(!('error' in doc.worker_status[worker.name])); | ||
}); | ||
it("should insert additional status", function() { | ||
var status = 'mystatus', | ||
additionalStatus = { | ||
foo: 'bar' | ||
}, | ||
doc = {}; | ||
worker._setWorkerStatus(doc, status, null, additionalStatus); | ||
assert.equal('object', typeof doc.worker_status); | ||
assert.equal('object', typeof doc.worker_status[worker.name]); | ||
assert.equal(additionalStatus.foo, doc.worker_status[worker.name].foo); | ||
}); | ||
}); | ||
@@ -163,0 +141,0 @@ |
2
27533
660
- Removednode.extend@>=1.0.0
- Removedfunction-bind@1.1.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedis@3.3.0(transitive)
- Removednode.extend@2.0.3(transitive)