From 60aeba732d35ae8ecacdc25ccdaba45b3174cc17 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 23 Mar 2014 14:37:03 -0700 Subject: [PATCH] Adjust `_.camelCase`, `_.kebabCase` and `_.snakeCase` doc examples and tests. --- lodash.js | 10 +++++----- test/test.js | 8 +++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lodash.js b/lodash.js index 7c7f4720b..009498216 100644 --- a/lodash.js +++ b/lodash.js @@ -6168,7 +6168,7 @@ * var object = { 'name': 'fred' }; * var other = { 'name': 'fred' }; * - * object == other; + * object == other; * // => false * * _.isEqual(object, other); @@ -6921,10 +6921,10 @@ * _.camelCase('Hello world'); * // => 'helloWorld' * - * _.camelCase('hello-world'); + * _.camelCase('--hello-world'); * // => 'helloWorld' * - * _.camelCase('hello_world'); + * _.camelCase('__hello_world__'); * // => 'helloWorld' */ var camelCase = createCompounder(function(result, word, index) { @@ -7044,7 +7044,7 @@ * _.kebabCase('helloWorld'); * // => 'hello-world' * - * _.kebabCase('hello_world'); + * _.kebabCase('__hello_world__'); * // => 'hello-world' */ var kebabCase = createCompounder(function(result, word, index) { @@ -7198,7 +7198,7 @@ * _.snakeCase('Hello world'); * // => 'hello_world' * - * _.snakeCase('hello-world'); + * _.snakeCase('--hello-world'); * // => 'hello_world' * * _.snakeCase('helloWorld'); diff --git a/test/test.js b/test/test.js index a517fd718..5ff9bde96 100644 --- a/test/test.js +++ b/test/test.js @@ -1019,11 +1019,9 @@ 'd', 'n', 'o', 'o', 'o', 'o', 'o', '', 'o', 'u', 'u', 'u', 'u', 'y', 'th', 'y' ]; - test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', 3, function() { - _.forEach(['Hello world', 'helloWorld', 'hello-world', 'hello_world'], function(string) { - if (string != expected) { - equal(func(string), expected); - } + test('`_.' + methodName + '` should convert `string` to ' + caseName + ' case', 4, function() { + _.forEach(['Hello world', 'helloWorld', '--hello-world', '__hello_world__'], function(string) { + equal(func(string), expected); }); });