diff --git a/test/objects.js b/test/objects.js index 5fa9168ab..a3bdd5677 100644 --- a/test/objects.js +++ b/test/objects.js @@ -2,27 +2,8 @@ $(document).ready(function() { module("Object functions (values, extend, isEqual, and so on...)"); - function raises(block, expected, message) { - var pass = typeof block == 'function', - isRegExp = expected && Object.prototype.toString.call(expected) == '[object RegExp]', - isFunction = !isRegExp && typeof expected == 'function'; - if (!isFunction && !isRegExp && message == null) { - message = expected; - expected = null; - } - if (pass) { - try { - block(); - pass = false; - } catch (error) { - pass = expected == null || (isRegExp && expected.test(error)) || (isFunction && expected.call(null, error)); - } - } - ok(pass, typeof message == 'string' && message || 'error'); - } - test("objects: keys", function() { - var exception = /TypeError/; + var exception = /object/; equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); raises(function() { _.keys(null); }, exception, 'throws an error for `null` values'); raises(function() { _.keys(void 0); }, exception, 'throws an error for `undefined` values'); diff --git a/test/test.html b/test/test.html index dbc30a7e8..c67acf596 100644 --- a/test/test.html +++ b/test/test.html @@ -22,13 +22,13 @@
A representative sample of the functions are benchmarked here, to provide
a sense of how fast they might run in different browsers.
Each iteration runs on an array of 1000 elements.
For example, the 'intersect' test measures the number of times you can
find the intersection of two thousand-element arrays in one second.
-
+