Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wearefractal/vinyl-fs
Browse files Browse the repository at this point in the history
  • Loading branch information
Contra committed Jul 14, 2015
2 parents b481130 + 30a8507 commit 65090b8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
29 changes: 29 additions & 0 deletions test/dest.js
Expand Up @@ -572,6 +572,35 @@ describe('dest stream', function() {
stream.end();
});

it('should change to the specified base', function(done) {
var inputBase = path.join(__dirname, './fixtures');
var inputPath = path.join(__dirname, './fixtures/wow/suchempty');

var firstFile = new File({
base: inputBase,
cwd: __dirname,
path: inputPath,
stat: fs.statSync(inputPath)
});

var onEnd = function(){
buffered[0].base.should.equal(inputBase);
done();
};

var stream = vfs.dest('./out-fixtures/', {
cwd: __dirname,
base: inputBase
});

var buffered = [];
bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd);

stream.pipe(bufferStream);
stream.write(firstFile);
stream.end();
});

it('should report IO errors', function(done) {
var inputPath = path.join(__dirname, './fixtures/test.coffee');
var inputBase = path.join(__dirname, './fixtures/');
Expand Down
31 changes: 30 additions & 1 deletion test/symlink.js
Expand Up @@ -300,7 +300,7 @@ describe('symlink stream', function() {
stream.write(expectedFile);
stream.end();
});

it('should use different modes for files and directories', function(done) {
var inputBase = path.join(__dirname, './fixtures');
var inputPath = path.join(__dirname, './fixtures/wow/suchempty');
Expand Down Expand Up @@ -335,6 +335,35 @@ describe('symlink stream', function() {
stream.end();
});

it('should change to the specified base', function(done) {
var inputBase = path.join(__dirname, './fixtures');
var inputPath = path.join(__dirname, './fixtures/wow/suchempty');

var firstFile = new File({
base: inputBase,
cwd: __dirname,
path: inputPath,
stat: fs.statSync(inputPath)
});

var onEnd = function(){
buffered[0].base.should.equal(inputBase);
done();
};

var stream = vfs.symlink('./out-fixtures/', {
cwd: __dirname,
base: inputBase
});

var buffered = [];
bufferStream = through.obj(dataWrap(buffered.push.bind(buffered)), onEnd);

stream.pipe(bufferStream);
stream.write(firstFile);
stream.end();
});

it('should report IO errors', function(done) {
var inputPath = path.join(__dirname, './fixtures/test.coffee');
var inputBase = path.join(__dirname, './fixtures/');
Expand Down

0 comments on commit 65090b8

Please sign in to comment.