@@ -11,22 +11,22 @@ var api = vows.prepare({
11
11
version : function ( ) { return '1.0' }
12
12
} , [ 'get' ] ) ;
13
13
14
- var promiser = function ( val ) {
14
+ var emitNextTick = function ( val ) {
15
15
return function ( ) {
16
- var promise = new ( events . EventEmitter ) ;
17
- process . nextTick ( function ( ) { promise . emit ( 'success' , val ) } ) ;
18
- return promise ;
16
+ var emitter = new ( events . EventEmitter ) ;
17
+ process . nextTick ( function ( ) { emitter . emit ( 'success' , val ) } ) ;
18
+ return emitter ;
19
19
}
20
20
} ;
21
21
22
22
vows . describe ( "Vows" ) . addBatch ( {
23
23
"A context" : {
24
- topic : promiser ( "hello world" ) ,
24
+ topic : emitNextTick ( "hello world" ) ,
25
25
26
26
"with a nested context" : {
27
27
topic : function ( parent ) {
28
28
this . state = 42 ;
29
- return promiser ( parent ) ( ) ;
29
+ return emitNextTick ( parent ) ( ) ;
30
30
} ,
31
31
"has access to the environment" : function ( ) {
32
32
assert . equal ( this . state , 42 ) ;
@@ -47,24 +47,24 @@ vows.describe("Vows").addBatch({
47
47
}
48
48
} ,
49
49
"A nested context" : {
50
- topic : promiser ( 1 ) ,
50
+ topic : emitNextTick ( 1 ) ,
51
51
52
52
"." : {
53
- topic : function ( a ) { return promiser ( 2 ) ( ) } ,
53
+ topic : function ( a ) { return emitNextTick ( 2 ) ( ) } ,
54
54
55
55
"." : {
56
- topic : function ( b , a ) { return promiser ( 3 ) ( ) } ,
56
+ topic : function ( b , a ) { return emitNextTick ( 3 ) ( ) } ,
57
57
58
58
"." : {
59
- topic : function ( c , b , a ) { return promiser ( [ 4 , c , b , a ] ) ( ) } ,
59
+ topic : function ( c , b , a ) { return emitNextTick ( [ 4 , c , b , a ] ) ( ) } ,
60
60
61
61
"should have access to the parent topics" : function ( topics ) {
62
62
assert . equal ( topics . join ( ) , [ 4 , 3 , 2 , 1 ] . join ( ) ) ;
63
63
}
64
64
} ,
65
65
66
66
"from" : {
67
- topic : function ( c , b , a ) { return promiser ( [ 4 , c , b , a ] ) ( ) } ,
67
+ topic : function ( c , b , a ) { return emitNextTick ( [ 4 , c , b , a ] ) ( ) } ,
68
68
69
69
"the parent topics" : function ( topics ) {
70
70
assert . equal ( topics . join ( ) , [ 4 , 3 , 2 , 1 ] . join ( ) ) ;
@@ -121,9 +121,9 @@ vows.describe("Vows").addBatch({
121
121
}
122
122
}
123
123
} ,
124
- "A non-promise return value" : {
124
+ "A non-EventEmitter return value" : {
125
125
topic : function ( ) { return 1 } ,
126
- "should be converted to a promise " : function ( val ) {
126
+ "should be converted to a vow " : function ( val ) {
127
127
assert . equal ( val , 1 ) ;
128
128
}
129
129
} ,
@@ -173,11 +173,11 @@ vows.describe("Vows").addBatch({
173
173
} ,
174
174
"A topic emitting an error" : {
175
175
topic : function ( ) {
176
- var promise = new ( events . EventEmitter ) ;
176
+ var emitter = new ( events . EventEmitter ) ;
177
177
process . nextTick ( function ( ) {
178
- promise . emit ( "error" , 404 ) ;
178
+ emitter . emit ( "error" , 404 ) ;
179
179
} ) ;
180
- return promise ;
180
+ return emitter ;
181
181
} ,
182
182
"shouldn't raise an exception if the test expects it" : function ( e , res ) {
183
183
assert . equal ( e , 404 ) ;
@@ -186,11 +186,11 @@ vows.describe("Vows").addBatch({
186
186
} ,
187
187
"A topic not emitting an error" : {
188
188
topic : function ( ) {
189
- var promise = new ( events . EventEmitter ) ;
189
+ var emitter = new ( events . EventEmitter ) ;
190
190
process . nextTick ( function ( ) {
191
- promise . emit ( "success" , true ) ;
191
+ emitter . emit ( "success" , true ) ;
192
192
} ) ;
193
- return promise ;
193
+ return emitter ;
194
194
} ,
195
195
"should pass `null` as first argument, if the test is expecting an error" : function ( e , res ) {
196
196
assert . strictEqual ( e , null ) ;
@@ -581,12 +581,12 @@ vows.describe("Vows with sub events").addBatch({
581
581
events . EventEmitter . call ( this ) ;
582
582
} ;
583
583
require ( 'util' ) . inherits ( MyEmitter , events . EventEmitter ) ;
584
-
584
+
585
585
var topic = new ( MyEmitter ) ;
586
586
process . nextTick ( function ( ) {
587
587
topic . emit ( 'success' , 'Legacy Does not Catch' ) ;
588
588
} ) ;
589
-
589
+
590
590
return topic ;
591
591
} ,
592
592
"will return the emitter for traditional vows" : function ( err , ret ) {
0 commit comments