Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit d3a607b

Browse files
committed
More rearranging.
1 parent ae2e1ea commit d3a607b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

tests/app/strings.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,30 @@ define([
1414
});
1515

1616
it('you should be able to wrap lines at some arbitrary count, but don\'t break words', function() {
17-
//create the data
1817
var formattedStr;
19-
var data = [
18+
var wrapCol = 5;
19+
var input = [
2020
'abcdef abcde abc def',
2121
'abc abc abc',
2222
'a b c def'
2323
];
24-
var wrapCol = 5;
25-
26-
var computedData = [
24+
var output = [
2725
'abcdef\nabcde\nabc\ndef',
2826
'abc\nabc\nabc',
2927
'a b c\ndef'
3028
];
3129

3230

33-
data.forEach(function(str, index) {
31+
input.forEach(function(str, index) {
3432
formattedStr = answers.wordWrap(str, wrapCol);
3533
//every char at the wrap line should be a space
36-
expect(formattedStr).to.eql(computedData[index]);
34+
expect(formattedStr).to.eql(output[index]);
3735
//the last characters should still be the last characters
38-
expect(formattedStr.charAt(formattedStr.length-1)).to.eql(computedData[index].charAt(computedData[index].length-1));
36+
expect(formattedStr.charAt(formattedStr.length-1)).to.eql(output[index].charAt(output[index].length-1));
3937
});
4038

4139
});
42-
40+
4341
it('you should be able to reverse a string', function() {
4442
var data = [
4543
'abc',

0 commit comments

Comments
 (0)