Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

windows compatible test

make the test compatible with windows where grep is not exists
  • Loading branch information...
commit 9b5f06c178f8791fd4ddcc853318199dd4ad2ca2 1 parent e4e955a
@speier speier authored
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, '');
}));
Please sign in to comment.
Something went wrong with that request. Please try again.