Skip to content

Commit

Permalink
[test refactor] Merge test/gh-1-regression-test.js into test/cliff-te…
Browse files Browse the repository at this point in the history
…st.js
  • Loading branch information
indexzero committed Jan 23, 2012
1 parent 5d8bf75 commit a7dac3a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 53 deletions.
53 changes: 42 additions & 11 deletions test/cliff-test.js
Expand Up @@ -29,19 +29,50 @@ vows.describe('cliff').addBatch({
} }
}, },
"the arrayLengths() method": { "the arrayLengths() method": {
"should respond with a list of the longest elements": function () { "with a set of strings": {
var lengths, rows = [ "should respond with a list of the longest elements": function () {
["1a", "2a", "3a", "4a"], var lengths, rows = [
["1b", "2bb", "3b", "4b"], ["1a", "2a", "3a", "4a"],
["1c", "2c", "3ccc", "4c"], ["1b", "2bb", "3b", "4b"],
["1d", "2d", "3dd", "4dddd"] ["1c", "2c", "3ccc", "4c"],
["1d", "2d", "3dd", "4dddd"]
];

lengths = cliff.arrayLengths(rows);
assert.equal(lengths[0], 2);
assert.equal(lengths[1], 3);
assert.equal(lengths[2], 4);
assert.equal(lengths[3], 5);
}
},
"with a set of numbers and strings": {
"should respond with a list of the longest elements": function () {
var lengths, rows = [
[11, "2a", "3a", "4a"],
["1b", 222, "3b", "4b"],
["1c", "2c", 3333, "4c"],
["1d", "2d", "3dd", 44444]
];

lengths = cliff.arrayLengths(rows);
assert.equal(lengths[0], 2);
assert.equal(lengths[1], 3);
assert.equal(lengths[2], 4);
assert.equal(lengths[3], 5);
}
}
},
"the stringifyRows() method": {
"should calculate padding correctly for numbers": function() {
var rows = [
['a', 'b'],
[12345, 1]
]; ];


lengths = cliff.arrayLengths(rows); assert.equal(
assert.equal(lengths[0], 2); cliff.stringifyRows(rows),
assert.equal(lengths[1], 3); 'a b \n12345 1 '
assert.equal(lengths[2], 4); );
assert.equal(lengths[3], 5);
} }
} }
} }
Expand Down
42 changes: 0 additions & 42 deletions test/gh-1-regression-test.js

This file was deleted.

0 comments on commit a7dac3a

Please sign in to comment.