Comparing version 0.1.0 to 0.2.0
@@ -37,2 +37,6 @@ var path = require('path'); | ||
File.prototype.isDirectory = function() { | ||
return this.isNull() && this.stat && this.stat.isDirectory(); | ||
}; | ||
File.prototype.clone = function() { | ||
@@ -39,0 +43,0 @@ var clonedStat = clone(this.stat); |
{ | ||
"name": "vinyl", | ||
"description": "A virtual file format", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "http://github.com/wearefractal/vinyl", | ||
@@ -6,0 +6,0 @@ "repository": "git://github.com/wearefractal/vinyl.git", |
@@ -149,2 +149,30 @@ var File = require('../'); | ||
describe('isDirectory()', function() { | ||
var fakeStat = { | ||
isDirectory: function() { | ||
return true; | ||
} | ||
}; | ||
it('should return false when the contents are a Buffer', function(done) { | ||
var val = new Buffer("test"); | ||
var file = new File({contents: val, stat: fakeStat}); | ||
file.isDirectory().should.equal(false); | ||
done(); | ||
}); | ||
it('should return false when the contents are a Stream', function(done) { | ||
var val = new Stream(); | ||
var file = new File({contents: val, stat: fakeStat}); | ||
file.isDirectory().should.equal(false); | ||
done(); | ||
}); | ||
it('should return true when the contents are a null', function(done) { | ||
var file = new File({contents: null, stat: fakeStat}); | ||
file.isDirectory().should.equal(true); | ||
done(); | ||
}); | ||
}); | ||
describe('clone()', function() { | ||
@@ -151,0 +179,0 @@ it('should copy all attributes over with Buffer', function(done) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25655
640