@@ -4,7 +4,7 @@ var concat = require('concat-stream');
4
4
5
5
tap . test ( 'exit ok' , function ( t ) {
6
6
t . plan ( 2 ) ;
7
-
7
+
8
8
var tc = function ( rows ) {
9
9
t . same ( rows . toString ( 'utf8' ) , [
10
10
'TAP version 13' ,
@@ -21,12 +21,13 @@ tap.test('exit ok', function (t) {
21
21
'# pass 5' ,
22
22
'' ,
23
23
'# ok' ,
24
- '' ,
25
- ''
24
+ '' , // yes, these double-blank-lines at the end are required.
25
+ '' // if you can figure out how to remove them, please do!
26
26
] . join ( '\n' ) ) ;
27
27
}
28
-
29
- var ps = spawn ( process . execPath , [ __dirname + '/exit/ok.js' ] ) ;
28
+
29
+ var ps = spawn ( process . execPath ,
30
+ [ require ( 'path' ) . join ( __dirname , 'exit' , 'ok.js' ) ] ) ;
30
31
ps . stdout . pipe ( concat ( tc ) ) ;
31
32
ps . on ( 'exit' , function ( code ) {
32
33
t . equal ( code , 0 ) ;
@@ -35,7 +36,7 @@ tap.test('exit ok', function (t) {
35
36
36
37
tap . test ( 'exit fail' , function ( t ) {
37
38
t . plan ( 2 ) ;
38
-
39
+
39
40
var tc = function ( rows ) {
40
41
t . same ( rows . toString ( 'utf8' ) , [
41
42
'TAP version 13' ,
@@ -59,8 +60,9 @@ tap.test('exit fail', function (t) {
59
60
''
60
61
] . join ( '\n' ) ) ;
61
62
} ;
62
-
63
- var ps = spawn ( process . execPath , [ __dirname + '/exit/fail.js' ] ) ;
63
+
64
+ var ps = spawn ( process . execPath ,
65
+ [ require ( 'path' ) . join ( __dirname , 'exit' , 'fail.js' ) ] ) ;
64
66
ps . stdout . pipe ( concat ( tc ) ) ;
65
67
ps . on ( 'exit' , function ( code ) {
66
68
t . notEqual ( code , 0 ) ;
@@ -69,8 +71,8 @@ tap.test('exit fail', function (t) {
69
71
70
72
tap . test ( 'too few exit' , function ( t ) {
71
73
t . plan ( 2 ) ;
72
-
73
- var tc = function ( rows ) {
74
+
75
+ var tc = function ( rows ) {
74
76
t . same ( rows . toString ( 'utf8' ) , [
75
77
'TAP version 13' ,
76
78
'# array' ,
@@ -94,7 +96,7 @@ tap.test('too few exit', function (t) {
94
96
''
95
97
] . join ( '\n' ) ) ;
96
98
} ;
97
-
99
+
98
100
var ps = spawn ( process . execPath , [ __dirname + '/exit/too_few.js' ] ) ;
99
101
ps . stdout . pipe ( concat ( tc ) ) ;
100
102
ps . on ( 'exit' , function ( code ) {
@@ -104,7 +106,7 @@ tap.test('too few exit', function (t) {
104
106
105
107
tap . test ( 'more planned in a second test' , function ( t ) {
106
108
t . plan ( 2 ) ;
107
-
109
+
108
110
var tc = function ( rows ) {
109
111
t . same ( rows . toString ( 'utf8' ) , [
110
112
'TAP version 13' ,
@@ -127,7 +129,7 @@ tap.test('more planned in a second test', function (t) {
127
129
'' ,
128
130
] . join ( '\n' ) ) ;
129
131
} ;
130
-
132
+
131
133
var ps = spawn ( process . execPath , [ __dirname + '/exit/second.js' ] ) ;
132
134
ps . stdout . pipe ( concat ( tc ) ) ;
133
135
ps . on ( 'exit' , function ( code ) {
0 commit comments