diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:26:46 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:43:56 -0700 |
| commit | e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch) | |
| tree | 06284a538a6008eca75051399e47db4e5d50301c /node_modules/spawn-command/test | |
initial commit: scaffolding
Diffstat (limited to 'node_modules/spawn-command/test')
| -rw-r--r-- | node_modules/spawn-command/test/fixtures/commit | 9 | ||||
| -rw-r--r-- | node_modules/spawn-command/test/spawn-command-test.js | 26 |
2 files changed, 35 insertions, 0 deletions
diff --git a/node_modules/spawn-command/test/fixtures/commit b/node_modules/spawn-command/test/fixtures/commit new file mode 100644 index 0000000..a149be1 --- /dev/null +++ b/node_modules/spawn-command/test/fixtures/commit @@ -0,0 +1,9 @@ +commit 26b11915b1c16440468a4b5f4b07d2409b98c68c +Author: Bert Belder <bertbelder@gmail.com> +Date: Wed Jun 20 01:07:57 2012 +0200 + + test-domain: fix the test to work on Windows + + On Windows, full pathnames are stored in the Error object when + a file i/o error happens. This is not the case on Unix. Before + this fix the test would break because of these full paths. diff --git a/node_modules/spawn-command/test/spawn-command-test.js b/node_modules/spawn-command/test/spawn-command-test.js new file mode 100644 index 0000000..f74739a --- /dev/null +++ b/node_modules/spawn-command/test/spawn-command-test.js @@ -0,0 +1,26 @@ +var path = require('path'), + assert = require('assert'), + assertCalled = require('assert-called'), + spawnCommand = require('../'); + +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; + +child.stdout.on('data', function (chunk) { + stdout += chunk; +}); + +child.stderr.on('data', function (chunk) { + stderr += chunk; +}); + +child.on('exit', assertCalled(function (exitCode) { + assert.equal(exitCode, 0); + assert.equal(stdout, 'commit 26b11915b1c16440468a4b5f4b07d2409b98c68c' + newln); + assert.equal(stderr, ''); +})); |
