@@ -3,114 +3,112 @@ var assert = require('assert');
3
3
4
4
vows . describe ( 'vows/assert' ) . addBatch ( {
5
5
"The Assertion module" : {
6
- topic : require ( 'assert' ) ,
7
-
8
- "`equal`" : function ( assert ) {
6
+ "`equal`" : function ( ) {
9
7
assert . equal ( "hello world" , "hello world" ) ;
10
8
assert . equal ( 1 , true ) ;
11
9
} ,
12
- "`match`" : function ( assert ) {
10
+ "`match`" : function ( ) {
13
11
assert . match ( "hello world" , / ^ [ a - z ] + [ a - z ] + $ / ) ;
14
12
} ,
15
- "`length`" : function ( assert ) {
13
+ "`length`" : function ( ) {
16
14
assert . lengthOf ( "hello world" , 11 ) ;
17
15
assert . lengthOf ( [ 1 , 2 , 3 ] , 3 ) ;
18
16
} ,
19
- "`isDefined`" : function ( assert ) {
17
+ "`isDefined`" : function ( ) {
20
18
assert . isDefined ( null ) ;
21
19
assertError ( assert . isDefined , undefined ) ;
22
20
} ,
23
- "`include`" : function ( assert ) {
21
+ "`include`" : function ( ) {
24
22
assert . include ( "hello world" , "world" ) ;
25
23
assert . include ( [ 0 , 42 , 0 ] , 42 ) ;
26
24
assert . include ( { goo :true } , 'goo' ) ;
27
25
} ,
28
- "`deepInclude`" : function ( assert ) {
26
+ "`deepInclude`" : function ( ) {
29
27
assert . deepInclude ( [ { a :'b' } , { c :'d' } ] , { a :'b' } ) ;
30
28
assert . deepInclude ( "hello world" , "world" ) ;
31
29
assert . deepInclude ( { goo :true } , 'goo' ) ;
32
30
} ,
33
- "`typeOf`" : function ( assert ) {
31
+ "`typeOf`" : function ( ) {
34
32
assert . typeOf ( 'goo' , 'string' ) ;
35
33
assert . typeOf ( 42 , 'number' ) ;
36
34
assert . typeOf ( [ ] , 'array' ) ;
37
35
assert . typeOf ( { } , 'object' ) ;
38
36
assert . typeOf ( false , 'boolean' ) ;
39
37
} ,
40
- "`instanceOf`" : function ( assert ) {
38
+ "`instanceOf`" : function ( ) {
41
39
assert . instanceOf ( [ ] , Array ) ;
42
40
assert . instanceOf ( function ( ) { } , Function ) ;
43
41
} ,
44
- "`isArray`" : function ( assert ) {
42
+ "`isArray`" : function ( ) {
45
43
assert . isArray ( [ ] ) ;
46
44
assertError ( assert . isArray , { } ) ;
47
45
} ,
48
- "`isString`" : function ( assert ) {
46
+ "`isString`" : function ( ) {
49
47
assert . isString ( "" ) ;
50
48
} ,
51
- "`isObject`" : function ( assert ) {
49
+ "`isObject`" : function ( ) {
52
50
assert . isObject ( { } ) ;
53
51
assertError ( assert . isObject , [ ] ) ;
54
52
} ,
55
- "`isNumber`" : function ( assert ) {
53
+ "`isNumber`" : function ( ) {
56
54
assert . isNumber ( 0 ) ;
57
55
} ,
58
- "`isBoolean`" : function ( assert ) {
56
+ "`isBoolean`" : function ( ) {
59
57
assert . isBoolean ( true ) ;
60
58
assert . isBoolean ( false ) ;
61
59
assertError ( assert . isBoolean , 0 ) ;
62
60
} ,
63
- "`isNan`" : function ( assert ) {
61
+ "`isNan`" : function ( ) {
64
62
assert . isNaN ( 0 / 0 ) ;
65
63
} ,
66
- "`isTrue`" : function ( assert ) {
64
+ "`isTrue`" : function ( ) {
67
65
assert . isTrue ( true ) ;
68
66
assertError ( assert . isTrue , 1 ) ;
69
67
} ,
70
- "`isFalse`" : function ( assert ) {
68
+ "`isFalse`" : function ( ) {
71
69
assert . isFalse ( false ) ;
72
70
assertError ( assert . isFalse , 0 ) ;
73
71
} ,
74
- "`isZero`" : function ( assert ) {
72
+ "`isZero`" : function ( ) {
75
73
assert . isZero ( 0 ) ;
76
74
assertError ( assert . isZero , null ) ;
77
75
} ,
78
- "`isNotZero`" : function ( assert ) {
76
+ "`isNotZero`" : function ( ) {
79
77
assert . isNotZero ( 1 ) ;
80
78
} ,
81
- "`isUndefined`" : function ( assert ) {
79
+ "`isUndefined`" : function ( ) {
82
80
assert . isUndefined ( undefined ) ;
83
81
assertError ( assert . isUndefined , null ) ;
84
82
} ,
85
- "`isDefined`" : function ( assert ) {
83
+ "`isDefined`" : function ( ) {
86
84
assert . isDefined ( null ) ;
87
85
assertError ( assert . isDefined , undefined ) ;
88
86
} ,
89
- "`isNull`" : function ( assert ) {
87
+ "`isNull`" : function ( ) {
90
88
assert . isNull ( null ) ;
91
89
assertError ( assert . isNull , 0 ) ;
92
90
assertError ( assert . isNull , undefined ) ;
93
91
} ,
94
- "`isNotNull`" : function ( assert ) {
92
+ "`isNotNull`" : function ( ) {
95
93
assert . isNotNull ( 0 ) ;
96
94
} ,
97
- "`greater` and `lesser`" : function ( assert ) {
95
+ "`greater` and `lesser`" : function ( ) {
98
96
assert . greater ( 5 , 4 ) ;
99
97
assert . lesser ( 4 , 5 ) ;
100
98
} ,
101
- "`inDelta`" : function ( assert ) {
99
+ "`inDelta`" : function ( ) {
102
100
assert . inDelta ( 42 , 40 , 5 ) ;
103
101
assert . inDelta ( 42 , 40 , 2 ) ;
104
102
assert . inDelta ( 42 , 42 , 0 ) ;
105
103
assert . inDelta ( 3.1 , 3.0 , 0.2 ) ;
106
104
assertError ( assert . inDelta , [ 42 , 40 , 1 ] ) ;
107
105
} ,
108
- "`isEmpty`" : function ( assert ) {
106
+ "`isEmpty`" : function ( ) {
109
107
assert . isEmpty ( { } ) ;
110
108
assert . isEmpty ( [ ] ) ;
111
109
assert . isEmpty ( "" ) ;
112
110
} ,
113
- "`isNotEmpty`" : function ( assert ) {
111
+ "`isNotEmpty`" : function ( ) {
114
112
assert . isNotEmpty ( { goo :true } ) ;
115
113
assert . isNotEmpty ( [ 1 ] ) ;
116
114
assert . isNotEmpty ( " " ) ;
0 commit comments