-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Gouch
committed
Nov 4, 2013
1 parent
c3df530
commit ab48c0e
Showing
3 changed files
with
183 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>To Title Case</title> | ||
<link href="http://code.jquery.com/qunit/qunit-1.12.0.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | ||
<script src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script> | ||
<script src="../to-title-case.js"></script> | ||
<script> | ||
(function($){ | ||
$.getJSON('tests.json', runTests); | ||
|
||
function runTests(testCases) { | ||
test('toTitleCase()', function(){ | ||
$.each(testCases, function(index, testCase){ | ||
deepEqual(testCase.input.toTitleCase(), testCase.expect, | ||
testCase.expect); | ||
}); | ||
}); | ||
} | ||
})(jQuery); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
[ | ||
{ | ||
"input": "follow step-by-step instructions", | ||
"expect": "Follow Step-by-Step Instructions" | ||
}, | ||
{ | ||
"input": "this sub-phrase is nice", | ||
"expect": "This Sub-Phrase Is Nice" | ||
}, | ||
{ | ||
"input": "catchy title: a subtitle", | ||
"expect": "Catchy Title: A Subtitle" | ||
}, | ||
{ | ||
"input": "catchy title: \"a quoted subtitle\"", | ||
"expect": "Catchy Title: \"A Quoted Subtitle\"" | ||
}, | ||
{ | ||
"input": "catchy title: “‘a twice quoted subtitle’”", | ||
"expect": "Catchy Title: “‘A Twice Quoted Subtitle’”" | ||
}, | ||
{ | ||
"input": "\"a title inside double quotes\"", | ||
"expect": "\"A Title Inside Double Quotes\"" | ||
}, | ||
{ | ||
"input": "all words capitalized", | ||
"expect": "All Words Capitalized" | ||
}, | ||
{ | ||
"input": "small words are for by and of lowercase", | ||
"expect": "Small Words Are for by and of Lowercase" | ||
}, | ||
{ | ||
"input": "a small word starts", | ||
"expect": "A Small Word Starts" | ||
}, | ||
{ | ||
"input": "a small word it ends on", | ||
"expect": "A Small Word It Ends On" | ||
}, | ||
{ | ||
"input": "do questions work?", | ||
"expect": "Do Questions Work?" | ||
}, | ||
{ | ||
"input": "multiple sentences. more than one.", | ||
"expect": "Multiple Sentences. More Than One." | ||
}, | ||
{ | ||
"input": "Ends with small word of", | ||
"expect": "Ends With Small Word Of" | ||
}, | ||
{ | ||
"input": "double quoted \"inner\" word", | ||
"expect": "Double Quoted \"Inner\" Word" | ||
}, | ||
{ | ||
"input": "single quoted 'inner' word", | ||
"expect": "Single Quoted 'Inner' Word" | ||
}, | ||
{ | ||
"input": "fancy double quoted “inner” word", | ||
"expect": "Fancy Double Quoted “Inner” Word" | ||
}, | ||
{ | ||
"input": "fancy single quoted ‘inner’ word", | ||
"expect": "Fancy Single Quoted ‘Inner’ Word" | ||
}, | ||
{ | ||
"input": "this vs. that", | ||
"expect": "This vs. That" | ||
}, | ||
{ | ||
"input": "this vs that", | ||
"expect": "This vs That" | ||
}, | ||
{ | ||
"input": "this v. that", | ||
"expect": "This v. That" | ||
}, | ||
{ | ||
"input": "this v that", | ||
"expect": "This v That" | ||
}, | ||
{ | ||
"input": "address email@example.com titles", | ||
"expect": "Address email@example.com Titles" | ||
}, | ||
{ | ||
"input": "pass camelCase through", | ||
"expect": "Pass camelCase Through" | ||
}, | ||
{ | ||
"input": "don't break", | ||
"expect": "Don't Break" | ||
}, | ||
{ | ||
"input": "catchy title: substance subtitle", | ||
"expect": "Catchy Title: Substance Subtitle" | ||
}, | ||
{ | ||
"input": "we keep NASA capitalized", | ||
"expect": "We Keep NASA Capitalized" | ||
}, | ||
{ | ||
"input": "leave Q&A unscathed", | ||
"expect": "Leave Q&A Unscathed" | ||
}, | ||
{ | ||
"input": "Scott Moritz and TheStreet.com’s million iPhone la-la land", | ||
"expect": "Scott Moritz and TheStreet.com’s Million iPhone La-La Land" | ||
}, | ||
{ | ||
"input": "you have a http://example.com/foo/ title", | ||
"expect": "You Have a http://example.com/foo/ Title" | ||
}, | ||
{ | ||
"input": "your hair[cut] looks (nice)", | ||
"expect": "Your Hair[cut] Looks (Nice)" | ||
}, | ||
{ | ||
"input": "keep that colo(u)r", | ||
"expect": "Keep That Colo(u)r" | ||
}, | ||
{ | ||
"input": "have you read “The Lottery”?", | ||
"expect": "Have You Read “The Lottery”?" | ||
}, | ||
{ | ||
"input": "Read markdown_rules.txt to find out how _underscores around words_ will be interpreted", | ||
"expect": "Read markdown_rules.txt to Find Out How _Underscores Around Words_ Will Be Interpreted" | ||
}, | ||
{ | ||
"input": "Read markdown_rules.txt to find out how *asterisks around words* will be interpreted", | ||
"expect": "Read markdown_rules.txt to Find Out How *Asterisks Around Words* Will Be Interpreted" | ||
}, | ||
{ | ||
"input": "Notes and observations regarding Apple’s announcements from ‘The Beat Goes On’ special event", | ||
"expect": "Notes and Observations Regarding Apple’s Announcements From ‘The Beat Goes On’ Special Event" | ||
}, | ||
{ | ||
"input": "Drink this piña colada while you listen to ænima", | ||
"expect": "Drink This Piña Colada While You Listen to Ænima" | ||
}, | ||
{ | ||
"input": "capitalize hyphenated words on-demand", | ||
"expect": "Capitalize Hyphenated Words On-Demand" | ||
}, | ||
{ | ||
"input": "take them on: special lower cases", | ||
"expect": "Take Them On: Special Lower Cases" | ||
} | ||
] |
This file was deleted.
Oops, something went wrong.