Add _#toString and _#valueOf.

Former-commit-id: adb194b6270fc72f794c69343891a2e891b90051
This commit is contained in:
John-David Dalton
2012-11-18 21:50:41 -08:00
parent 20630aeb47
commit 819d4abaa2
4 changed files with 48 additions and 1 deletions

View File

@@ -1922,6 +1922,28 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash(...).toString');
(function() {
test('should return the `toString` result of the wrapped value', function() {
var wrapped = _([1, 2, 3]);
equal(String(wrapped), '1,2,3');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash(...).valueOf');
(function() {
test('should return the `valueOf` result of the wrapped value', function() {
var wrapped = _(123);
equal(Number(wrapped), 123);
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash methods');
(function() {