Skip to content

Commit

Permalink
should still batch undefined values and try to evaluate them. (not pe…
Browse files Browse the repository at this point in the history
…rfect: #2)
  • Loading branch information
matthewmueller committed Jan 23, 2015
1 parent f5b5e8f commit d8f679e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function _batch() {
var values = {};
var errors = {};
keys(expected).forEach(function(key) {
if (undefined === actual[key]) return;
batch.push(function(next) {
expected[key](actual[key], function(err, val) {
if (err) {
Expand Down
13 changes: 13 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ describe('Rube', function() {
});
})

// it('should throw because it\'s missing an attribute', function(done) {
// var schema = Rube({
// a: Rube(String),
// b: Rube(String),
// c: Rube(String)
// }).or('a', 'b');

// schema.only('c')({}, function(err, v) {
// assert(err);
// done();
// });
// })

});

describe('.only(str)', function() {
Expand Down

0 comments on commit d8f679e

Please sign in to comment.