re-add checking for existing file before downloading

This commit is contained in:
jomo
2014-11-29 23:15:43 +01:00
parent 8cea2ed65f
commit e01cff53b2
3 changed files with 31 additions and 66 deletions

View File

@@ -133,23 +133,6 @@ describe('Crafatar', function() {
done();
});
});
it("should already have the files / not download", function(done) {
// FIXME: implement & remove this line
throw("Please re-implement this and add a new test");
assert.doesNotThrow(function() {
fs.openSync("face.png", "w");
fs.openSync("helm.png", "w");
networking.get_skin("http://textures.minecraft.net/texture/477be35554684c28bdeee4cf11c591d3c88afb77e0b98da893fd7bc318c65184", function(err, img) {
assert.strictEqual(err, null); // no error here, but it shouldn't throw exceptions
fs.unlinkSync("face.png");
fs.unlinkSync("helm.png");
done();
});
});
});
it("should default to Alex", function(done) {
assert.strictEqual(skins.default_skin("ec561538f3fd461daff5086b22154bce"), "alex");
done();
@@ -218,13 +201,4 @@ describe('Crafatar', function() {
done();
});
});
after(function() {
try {
// these files could be here if a test failed
fs.unlinkSync("face.png");
fs.unlinkSync("helm.png");
} catch(e){}
});
});
});