Skip to content
Browse files

passing stderr test

  • Loading branch information...
1 parent b203aa6 commit e6452754e3c7732187e76668958cb5818defd46a @substack committed Oct 2, 2012
Showing with 12 additions and 2 deletions.
  1. +12 −2 test/log.js
View
14 test/log.js
@@ -2,7 +2,7 @@ var test = require('tap').test;
var run = require('../');
var through = require('through');
-test('log ok', function (t) {
+test('stdout capture', function (t) {
t.plan(1);
var data = '';
@@ -16,5 +16,15 @@ test('log ok', function (t) {
);
}
);
- var ps = run('git', [ 'log' ]).pipe(ws);
+ run('git', [ 'log' ]).pipe(ws);
+});
+
+test('stderr capture', function (t) {
+ t.plan(2);
+
+ var ps = run('git', [ 'log' ], { cwd : '/tmp' });
+ ps.on('error', function (err) {
+ t.ok(/non-zero exit code/.test(err));
+ t.ok(/Not a git repository/.test(err));
+ });
});

0 comments on commit e645275

Please sign in to comment.
Something went wrong with that request. Please try again.