Comparing version 1.1.0 to 1.2.0
@@ -22,2 +22,7 @@ // Load Modules | ||
if (Array.isArray(id)) { | ||
this._run(this._table.getAll(RethinkDB.args(id)), 'get', id, callback); | ||
return; | ||
} | ||
this._run(this._table.get(id), 'get', id, callback); | ||
@@ -24,0 +29,0 @@ }; |
{ | ||
"name": "penseur", | ||
"description": "Lightweight RethinkDB wrapper", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/hueniverse/penseur", |
@@ -38,2 +38,62 @@ // Load modules | ||
}); | ||
it('returns the requested objects', function (done) { | ||
var db = new Penseur.Db('penseurtest'); | ||
db.establish(['test'], function (err) { | ||
expect(err).to.not.exist(); | ||
db.test.insert([{ id: 1, a: 1 }, { id: 2, a: 2 }, { id: 3, a: 1 }], function (err, keys) { | ||
expect(err).to.not.exist(); | ||
db.test.get([1, 3], function (err, result) { | ||
expect(err).to.not.exist(); | ||
expect(result).to.deep.include([{ id: 3, a: 1 }, { id: 1, a: 1 }]); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('returns the requested objects found (partial)', function (done) { | ||
var db = new Penseur.Db('penseurtest'); | ||
db.establish(['test'], function (err) { | ||
expect(err).to.not.exist(); | ||
db.test.insert([{ id: 1, a: 1 }, { id: 2, a: 2 }, { id: 3, a: 1 }], function (err, keys) { | ||
expect(err).to.not.exist(); | ||
db.test.get([1, 3, 4], function (err, result) { | ||
expect(err).to.not.exist(); | ||
expect(result).to.have.length(2); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('returns the requested objects found (duplicates)', function (done) { | ||
var db = new Penseur.Db('penseurtest'); | ||
db.establish(['test'], function (err) { | ||
expect(err).to.not.exist(); | ||
db.test.insert([{ id: 1, a: 1 }, { id: 2, a: 2 }, { id: 3, a: 1 }], function (err, keys) { | ||
expect(err).to.not.exist(); | ||
db.test.get([1, 3, 3], function (err, result) { | ||
expect(err).to.not.exist(); | ||
expect(result).to.have.length(3); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -40,0 +100,0 @@ |
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
30882
679