Skip to content

Commit

Permalink
[test minor] Change assert.length to assert.lengthOf
Browse files Browse the repository at this point in the history
`vows@0.5.12` changes syntax from `assert.length` to `assert.lengthOf`.
  • Loading branch information
mmalecki committed Nov 18, 2011
1 parent a6f8b54 commit 7b9fdff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions test/core-test.js
Expand Up @@ -17,7 +17,7 @@ vows.describe('api-easy/core').addBatch({
topic: apiEasy.describe('test/api').discuss('When using the Test API'),
"it should have the correct methods set": function () {
assert.isFunction(apiEasy.describe);
assert.length(Object.keys(apiEasy), 2);
assert.lengthOf(Object.keys(apiEasy), 2);
},
"and a valid suite": {
"it should have the correct methods set": function (suite) {
Expand All @@ -32,15 +32,15 @@ vows.describe('api-easy/core').addBatch({
suite.discuss('the Test Resource')
.discuss('and something else worth mentioning');

assert.length(suite.discussion, length + 2);
assert.lengthOf(suite.discussion, length + 2);
}
},
"the undiscuss() method": {
"should remove the last discussion text": function (suite) {
var length = suite.discussion.length;
suite.undiscuss();

assert.length(suite.discussion, length - 1);
assert.lengthOf(suite.discussion, length - 1);
}
},
"the use() method": {
Expand All @@ -54,21 +54,21 @@ vows.describe('api-easy/core').addBatch({
"should set the header appropriately": function (suite) {
var length = Object.keys(suite.outgoing.headers).length;
suite.setHeader('x-test-header', true);
assert.length(Object.keys(suite.outgoing.headers), length + 1);
assert.lengthOf(Object.keys(suite.outgoing.headers), length + 1);
}
},
"the removeHeader() method": {
"should remove the header appropriately": function (suite) {
var length = Object.keys(suite.outgoing.headers).length;
suite.removeHeader('x-test-header');
assert.length(Object.keys(suite.outgoing.headers), length - 1);
assert.lengthOf(Object.keys(suite.outgoing.headers), length - 1);
}
},
"the setHeaders() method": {
"should set all headers appropriately": function (suite) {
suite.setHeader('x-test-header', true);
suite.setHeaders({ 'Content-Type': 'application/json' });
assert.length(Object.keys(suite.outgoing.headers), 1);
assert.lengthOf(Object.keys(suite.outgoing.headers), 1);
assert.equal(suite.outgoing.headers['Content-Type'], 'application/json');
}
},
Expand All @@ -77,7 +77,7 @@ vows.describe('api-easy/core').addBatch({
suite.path('/tests');
var length = suite.paths.length;
suite.path('/more-tests');
assert.length(suite.paths, length + 1);
assert.lengthOf(suite.paths, length + 1);
assert.equal('more-tests', suite.paths[suite.paths.length - 1]);
}
},
Expand Down Expand Up @@ -145,7 +145,7 @@ vows.describe('api-easy/core').addBatch({
"the unbefore() method": {
"should remove the function from the set of before operations": function (suite) {
suite.unbefore('setAuth');
assert.length(Object.keys(suite.befores), 0);
assert.lengthOf(Object.keys(suite.befores), 0);
}
},
"with no path": {
Expand Down Expand Up @@ -213,4 +213,4 @@ vows.describe('api-easy/core').addBatch({
}
}
}
}).export(module);
}).export(module);
4 changes: 2 additions & 2 deletions test/helpers.js
Expand Up @@ -14,10 +14,10 @@ var helpers = exports,

reservedOptions = {
'length': function (batch, length) {
assert.length(Object.keys(batch), length);
assert.lengthOf(Object.keys(batch), length);
},
'before': function (batch, length) {
assert.length(Object.keys(batch.topic.before), length);
assert.lengthOf(Object.keys(batch.topic.before), length);
}
};

Expand Down

0 comments on commit 7b9fdff

Please sign in to comment.