forked from angus-c/just
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (27 loc) · 828 Bytes
/
Copy pathindex.js
File metadata and controls
31 lines (27 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var test = require('../util/test')(__filename);
var capitalize = require('../../packages/string-capitalize');
test('string lowercase', function(t) {
t.plan(2);
t.equal(capitalize('capitals'), 'Capitals');
t.equal(capitalize('some string'), 'Some string');
t.end();
});
test('lowercase remaining string', function(t) {
t.plan(2);
t.equal(capitalize('capiTALS'), 'Capitals');
t.equal(capitalize('some String'), 'Some string');
t.end();
});
test('string already capitalized', function(t) {
t.plan(2);
t.equal(capitalize('Capitals'), 'Capitals');
t.equal(capitalize('ALLCAPS'), 'Allcaps');
t.end();
});
test('non alpha chars', function(t) {
t.plan(3);
t.equal(capitalize('1two'), '1two');
t.equal(capitalize('!important'), '!important');
t.equal(capitalize(' spaces'), ' spaces');
t.end();
});