kopia lustrzana https://github.com/c9/core
add unit tests
rodzic
cfa07f4449
commit
e8dcd182f8
|
@ -49,7 +49,7 @@ describe('vfs-local', function () {
|
|||
});
|
||||
it('should reject paths that resolve outside the root', function (done) {
|
||||
vfs.resolve("/../test-local.js", {}, function (err, meta) {
|
||||
expect(err).property("code").equals("EACCESS");
|
||||
expect(err).property("code").equals("EACCES");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
@ -893,6 +893,12 @@ describe('vfs-local', function () {
|
|||
});
|
||||
});
|
||||
});
|
||||
it("should error with EACCES if the same extension name is empty", function (done) {
|
||||
vfs.extend("", {file: __dirname + "/math.js"}, function (err, meta) {
|
||||
expect(err).property("code").equal("EACCES");
|
||||
done();
|
||||
});
|
||||
});
|
||||
it("should allow a redefine if options.redefine is set", function (done) {
|
||||
vfs.extend("test", {file: __dirname + "/math.js"}, function (err, meta) {
|
||||
if (err) throw err;
|
||||
|
|
|
@ -34,7 +34,7 @@ module.exports = function(methods, vfsHome, vfsWorkspace) {
|
|||
|
||||
function wrap(name, excluded) {
|
||||
if (excluded) {
|
||||
return function(){
|
||||
return function() {
|
||||
vfsWorkspace[name].apply(vfsWorkspace, arguments);
|
||||
};
|
||||
}
|
||||
|
@ -43,7 +43,8 @@ module.exports = function(methods, vfsHome, vfsWorkspace) {
|
|||
var args = Array.prototype.slice.call(arguments);
|
||||
|
||||
PATH_OPTIONS.forEach(function(o) {
|
||||
options[o] = options[o] && substituteTilde(options[o]);
|
||||
if (options[o] && typeof options[o] == "string")
|
||||
options[o] = substituteTilde(options[o]);
|
||||
});
|
||||
args[1] = options;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue