Skip to content

Commit 82ba4d4

Browse files
committed
update all instances of spawn to use path.join for windows compatability as discussed in tape-testing#314 (comment)
1 parent ce0b410 commit 82ba4d4

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

test/default-messages.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ var concat = require('concat-stream');
55
tap.test('default messages', function (t) {
66
t.plan(1);
77

8-
var ps = spawn(process.execPath, [ __dirname + '/messages/defaults.js' ]);
8+
var ps = spawn(process.execPath,
9+
[ require('path').join(__dirname, 'messages', 'defaults.js') ]);
910

1011
ps.stdout.pipe(concat(function (rows) {
1112

test/double_end.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ var spawn = require('child_process').spawn;
44

55
test(function (t) {
66
t.plan(2);
7-
var ps = spawn(process.execPath, [ __dirname + '/double_end/double.js' ]);
7+
var ps = spawn(process.execPath,
8+
[ require('path').join(__dirname, 'double_end', 'double.js') ]);
89
ps.on('exit', function (code) {
910
t.equal(code, 1);
1011
});

test/exit.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var concat = require('concat-stream');
44

55
tap.test('exit ok', function (t) {
66
t.plan(2);
7-
7+
88
var tc = function (rows) {
99
t.same(rows.toString('utf8'), [
1010
'TAP version 13',
@@ -21,12 +21,13 @@ tap.test('exit ok', function (t) {
2121
'# pass 5',
2222
'',
2323
'# 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!
2626
].join('\n'));
2727
}
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') ]);
3031
ps.stdout.pipe(concat(tc));
3132
ps.on('exit', function (code) {
3233
t.equal(code, 0);
@@ -35,7 +36,7 @@ tap.test('exit ok', function (t) {
3536

3637
tap.test('exit fail', function (t) {
3738
t.plan(2);
38-
39+
3940
var tc = function (rows) {
4041
t.same(rows.toString('utf8'), [
4142
'TAP version 13',
@@ -59,8 +60,9 @@ tap.test('exit fail', function (t) {
5960
''
6061
].join('\n'));
6162
};
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') ]);
6466
ps.stdout.pipe(concat(tc));
6567
ps.on('exit', function (code) {
6668
t.notEqual(code, 0);
@@ -69,8 +71,8 @@ tap.test('exit fail', function (t) {
6971

7072
tap.test('too few exit', function (t) {
7173
t.plan(2);
72-
73-
var tc = function (rows) {
74+
75+
var tc = function (rows) {
7476
t.same(rows.toString('utf8'), [
7577
'TAP version 13',
7678
'# array',
@@ -94,7 +96,7 @@ tap.test('too few exit', function (t) {
9496
''
9597
].join('\n'));
9698
};
97-
99+
98100
var ps = spawn(process.execPath, [ __dirname + '/exit/too_few.js' ]);
99101
ps.stdout.pipe(concat(tc));
100102
ps.on('exit', function (code) {
@@ -104,7 +106,7 @@ tap.test('too few exit', function (t) {
104106

105107
tap.test('more planned in a second test', function (t) {
106108
t.plan(2);
107-
109+
108110
var tc = function (rows) {
109111
t.same(rows.toString('utf8'), [
110112
'TAP version 13',
@@ -127,7 +129,7 @@ tap.test('more planned in a second test', function (t) {
127129
'',
128130
].join('\n'));
129131
};
130-
132+
131133
var ps = spawn(process.execPath, [ __dirname + '/exit/second.js' ]);
132134
ps.stdout.pipe(concat(tc));
133135
ps.on('exit', function (code) {

test/max_listeners.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var spawn = require('child_process').spawn;
2-
var ps = spawn(process.execPath, [ __dirname + '/max_listeners/source.js' ]);
2+
var ps = spawn(process.execPath,
3+
[ require('path').join(__dirname, 'max_listeners', 'source.js') ]);
34
ps.stdout.pipe(process.stdout, { end : false });
45

56
ps.stderr.on('data', function (buf) {

0 commit comments

Comments
 (0)