Permalink
Browse files

passing read stream test

  • Loading branch information...
1 parent 7991469 commit be079cfd062a31f814bf80bc6b482f215854b20c @substack committed Oct 2, 2012
Showing with 28 additions and 0 deletions.
  1. +28 −0 test/read.js
View
@@ -0,0 +1,28 @@
+var test = require('tap').test;
+var git = require('../');
+var through = require('through');
+
+test('read an old example', function (t) {
+ t.plan(1);
+ var commit = '1b37f60da787df42edb863e5ea726e4dd7ce0457';
+ var file = 'example/x.js';
+
+ var data = '';
+ var tr = through(
+ function (buf) { data += buf },
+ function () {
+ t.equal(data, [
+ "var gitFile = require('../');",
+ "var joinStream = require('join-stream');",
+ "",
+ "gitFile.list(process.argv[2], process.argv[3])",
+ " .pipe(joinStream('\\n'))",
+ " .pipe(process.stdout)",
+ ";",
+ ""
+ ].join('\n'));
+ }
+ );
+
+ git.read(commit, file).pipe(tr);
+});

0 comments on commit be079cf

Please sign in to comment.