Permalink
Browse files

Merge pull request #1 from speier/master

windows compatible test
  • Loading branch information...
2 parents 11a3124 + 9b5f06c commit f927f00d9268fcacc4c06188f2705ed0577e2607 @mmalecki committed Nov 6, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 test/spawn-command-test.js
View
7 test/spawn-command-test.js
@@ -3,7 +3,10 @@ var path = require('path'),
assertCalled = require('assert-called'),
spawnCommand = require('../');
-var child = spawnCommand('grep commit < ' + path.join(__dirname, 'fixtures', 'commit')),
+var win32 = (process.platform === 'win32'),
+ newln = win32 ? '\r\n' : '\n',
+ grep = win32 ? 'findstr' : 'grep',
+ child = spawnCommand(grep + ' commit < ' + path.join(__dirname, 'fixtures', 'commit')),
stderr = '',
stdout = '',
exited = false;
@@ -18,6 +21,6 @@ child.stderr.on('data', function (chunk) {
child.on('exit', assertCalled(function (exitCode) {
assert.equal(exitCode, 0);
- assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c\n');
+ assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c' + newln);
assert.equal(stderr, '');
}));

0 comments on commit f927f00

Please sign in to comment.