Add more tested strings to the case methods.

This commit is contained in:
John-David Dalton
2015-01-02 19:00:27 -06:00
parent fab5daacf8
commit d81a6e6e89

View File

@@ -1432,15 +1432,15 @@
func = _[methodName]; func = _[methodName];
var strings = [ var strings = [
'hello world', 'Hello world', 'HELLO WORLD', 'foo bar', 'Foo bar', 'foo Bar', 'Foo Bar',
'helloWorld', '--hello-world', '__hello_world__' 'FOO BAR', 'fooBar', '--foo-bar', '__foo_bar__'
]; ];
var expected = (function() { var expected = (function() {
switch (caseName) { switch (caseName) {
case 'camel': return 'helloWorld'; case 'camel': return 'fooBar';
case 'kebab': return 'hello-world'; case 'kebab': return 'foo-bar';
case 'snake': return 'hello_world'; case 'snake': return 'foo_bar';
} }
}()); }());
@@ -1474,14 +1474,14 @@
}); });
test('`_.' + methodName + '` should coerce `string` to a string', 2, function() { test('`_.' + methodName + '` should coerce `string` to a string', 2, function() {
var string = 'Hello world'; var string = 'Foo Bar';
strictEqual(func(Object(string)), expected); strictEqual(func(Object(string)), expected);
strictEqual(func({ 'toString': _.constant(string) }), expected); strictEqual(func({ 'toString': _.constant(string) }), expected);
}); });
test('`_.' + methodName + '` should return an unwrapped value when chaining', 1, function() { test('`_.' + methodName + '` should return an unwrapped value when chaining', 1, function() {
if (!isNpm) { if (!isNpm) {
strictEqual(_('hello world')[methodName](), expected); strictEqual(_('foo bar')[methodName](), expected);
} }
else { else {
skipTest(); skipTest();