Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

failing test for the jobs command

  • Loading branch information...
commit 9f5b747a600bb2c311c6f611925649edd8cb8dfa 1 parent f7c213e
@substack authored
Showing with 28 additions and 0 deletions.
  1. +28 −0 test/jobs.js
View
28 test/jobs.js
@@ -0,0 +1,28 @@
+var test = require('tape');
+var bash = require('../');
+var through = require('through');
+var concat = require('concat-stream');
+
+test('jobs', function (t) {
+ t.plan(1);
+
+ var sh = bash({ spawn: run, env: { 'PS1': '' } });
+
+ var s = sh.createStream();
+ s.pipe(concat(function (src) {
+ t.equal(src + '', '[0] beep\nboop!\n');
+ }));
+ s.write('beep &\njobs\n');
+ s.end();
+});
+
+function run (cmd, args) {
+ if (cmd === 'beep') {
+ var tr = through();
+ setTimeout(function () {
+ tr.queue('boop!\n');
+ tr.queue(null);
+ }, 100);
+ return tr;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.