Move deep _.defaults implementation unit test to _.partialRight.

Former-commit-id: 7e5c6184d24b47170ef148122ef5c7428f8b2da9
This commit is contained in:
John-David Dalton
2013-01-20 12:09:44 -08:00
parent 82049096e6
commit a457675ce1

View File

@@ -1466,14 +1466,6 @@
deepEqual(actual, { 'a': 2 });
});
test('should work as a deep `_.defaults`', function() {
var object = { 'a': { 'b': 1 } },
source = { 'a': { 'b': 2, 'c': 3 } },
expected = { 'a': { 'b': 1, 'c': 3 } };
deepEqual(_.merge(object, source, _.defaults), expected);
});
}(1, 2, 3));
/*--------------------------------------------------------------------------*/
@@ -1584,6 +1576,21 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.partialRight');
(function() {
test('should work as a deep `_.defaults`', function() {
var object = { 'a': { 'b': 1 } },
source = { 'a': { 'b': 2, 'c': 3 } },
expected = { 'a': { 'b': 1, 'c': 3 } };
var deepDefaults = _.partialRight(_.merge, _.defaults);
deepEqual(deepDefaults(object, source), expected);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.pick');
(function() {