Add string test for _.shuffle.

Former-commit-id: 420789264a287b5431322b9871a3c1c219ff2722
This commit is contained in:
John-David Dalton
2013-08-17 08:15:42 -07:00
parent 2abae2f21a
commit 508cada017

View File

@@ -3323,6 +3323,17 @@
var actual = _.shuffle({ 'a': 1, 'b': 2, 'c': 3 });
deepEqual(actual.sort(), [1, 2, 3]);
});
_.forEach({
'literal': 'abc',
'object': Object('abc')
},
function(collection, key) {
test('should work with a string ' + key + ' for `collection`', function() {
var actual = _.shuffle(collection);
deepEqual(actual.sort(), ['a','b', 'c']);
});
});
}());
/*--------------------------------------------------------------------------*/