Skip to content

Commit 50052f5

Browse files
committed
[test v0.6] Make assert-test.js v0.6-compatible
Since nodejs/node-v0.x-archive@8c8d518, `assert` module is a function. When you look at lib/vows/suite.js:126, it checks if topic is a function and then, if it is, it executes it and passes results down to vows. Of course, it fails hard in this case, since `assert` module is a function (resulting in error without a stack trace).
1 parent fde1216 commit 50052f5

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

test/assert-test.js

+26-28
Original file line numberDiff line numberDiff line change
@@ -3,114 +3,112 @@ var assert = require('assert');
33

44
vows.describe('vows/assert').addBatch({
55
"The Assertion module": {
6-
topic: require('assert'),
7-
8-
"`equal`": function (assert) {
6+
"`equal`": function () {
97
assert.equal("hello world", "hello world");
108
assert.equal(1, true);
119
},
12-
"`match`": function (assert) {
10+
"`match`": function () {
1311
assert.match("hello world", /^[a-z]+ [a-z]+$/);
1412
},
15-
"`length`": function (assert) {
13+
"`length`": function () {
1614
assert.lengthOf("hello world", 11);
1715
assert.lengthOf([1, 2, 3], 3);
1816
},
19-
"`isDefined`": function (assert) {
17+
"`isDefined`": function () {
2018
assert.isDefined(null);
2119
assertError(assert.isDefined, undefined);
2220
},
23-
"`include`": function (assert) {
21+
"`include`": function () {
2422
assert.include("hello world", "world");
2523
assert.include([0, 42, 0], 42);
2624
assert.include({goo:true}, 'goo');
2725
},
28-
"`deepInclude`": function (assert) {
26+
"`deepInclude`": function () {
2927
assert.deepInclude([{a:'b'},{c:'d'}], {a:'b'});
3028
assert.deepInclude("hello world", "world");
3129
assert.deepInclude({goo:true}, 'goo');
3230
},
33-
"`typeOf`": function (assert) {
31+
"`typeOf`": function () {
3432
assert.typeOf('goo', 'string');
3533
assert.typeOf(42, 'number');
3634
assert.typeOf([], 'array');
3735
assert.typeOf({}, 'object');
3836
assert.typeOf(false, 'boolean');
3937
},
40-
"`instanceOf`": function (assert) {
38+
"`instanceOf`": function () {
4139
assert.instanceOf([], Array);
4240
assert.instanceOf(function () {}, Function);
4341
},
44-
"`isArray`": function (assert) {
42+
"`isArray`": function () {
4543
assert.isArray([]);
4644
assertError(assert.isArray, {});
4745
},
48-
"`isString`": function (assert) {
46+
"`isString`": function () {
4947
assert.isString("");
5048
},
51-
"`isObject`": function (assert) {
49+
"`isObject`": function () {
5250
assert.isObject({});
5351
assertError(assert.isObject, []);
5452
},
55-
"`isNumber`": function (assert) {
53+
"`isNumber`": function () {
5654
assert.isNumber(0);
5755
},
58-
"`isBoolean`": function (assert){
56+
"`isBoolean`": function (){
5957
assert.isBoolean(true);
6058
assert.isBoolean(false);
6159
assertError(assert.isBoolean, 0);
6260
},
63-
"`isNan`": function (assert) {
61+
"`isNan`": function () {
6462
assert.isNaN(0/0);
6563
},
66-
"`isTrue`": function (assert) {
64+
"`isTrue`": function () {
6765
assert.isTrue(true);
6866
assertError(assert.isTrue, 1);
6967
},
70-
"`isFalse`": function (assert) {
68+
"`isFalse`": function () {
7169
assert.isFalse(false);
7270
assertError(assert.isFalse, 0);
7371
},
74-
"`isZero`": function (assert) {
72+
"`isZero`": function () {
7573
assert.isZero(0);
7674
assertError(assert.isZero, null);
7775
},
78-
"`isNotZero`": function (assert) {
76+
"`isNotZero`": function () {
7977
assert.isNotZero(1);
8078
},
81-
"`isUndefined`": function (assert) {
79+
"`isUndefined`": function () {
8280
assert.isUndefined(undefined);
8381
assertError(assert.isUndefined, null);
8482
},
85-
"`isDefined`": function (assert) {
83+
"`isDefined`": function () {
8684
assert.isDefined(null);
8785
assertError(assert.isDefined, undefined);
8886
},
89-
"`isNull`": function (assert) {
87+
"`isNull`": function () {
9088
assert.isNull(null);
9189
assertError(assert.isNull, 0);
9290
assertError(assert.isNull, undefined);
9391
},
94-
"`isNotNull`": function (assert) {
92+
"`isNotNull`": function () {
9593
assert.isNotNull(0);
9694
},
97-
"`greater` and `lesser`": function (assert) {
95+
"`greater` and `lesser`": function () {
9896
assert.greater(5, 4);
9997
assert.lesser(4, 5);
10098
},
101-
"`inDelta`": function (assert) {
99+
"`inDelta`": function () {
102100
assert.inDelta(42, 40, 5);
103101
assert.inDelta(42, 40, 2);
104102
assert.inDelta(42, 42, 0);
105103
assert.inDelta(3.1, 3.0, 0.2);
106104
assertError(assert.inDelta, [42, 40, 1]);
107105
},
108-
"`isEmpty`": function (assert) {
106+
"`isEmpty`": function () {
109107
assert.isEmpty({});
110108
assert.isEmpty([]);
111109
assert.isEmpty("");
112110
},
113-
"`isNotEmpty`": function (assert) {
111+
"`isNotEmpty`": function () {
114112
assert.isNotEmpty({goo:true});
115113
assert.isNotEmpty([1]);
116114
assert.isNotEmpty(" ");

0 commit comments

Comments
 (0)