2015-09-14 09:22:54 +00:00
|
|
|
define(["untar"], function(untar) {
|
|
|
|
|
2015-08-26 14:45:13 +00:00
|
|
|
describe("untar", function() {
|
2015-09-14 09:22:54 +00:00
|
|
|
|
|
|
|
console.log("untar: " + JSON.stringify(untar));
|
|
|
|
|
|
|
|
var fileNames = [
|
|
|
|
"1.txt",
|
|
|
|
"2.txt",
|
|
|
|
"3.txt",
|
|
|
|
"directory/",
|
|
|
|
"directory/1.txt",
|
|
|
|
"directory/2.txt",
|
|
|
|
"directory/3.txt"
|
|
|
|
];
|
|
|
|
|
|
|
|
it("should unpack 3 specific files and a directory with 3 specific files", function(done) {
|
|
|
|
var i = 0;
|
|
|
|
|
|
|
|
untar("/base/spec/data/test.tar").then(
|
2015-08-26 14:45:13 +00:00
|
|
|
function(files) {
|
2015-09-14 09:22:54 +00:00
|
|
|
expect(files.length).toBe(7);
|
2015-08-26 14:45:13 +00:00
|
|
|
done();
|
|
|
|
},
|
|
|
|
function(err) {
|
|
|
|
done.fail(JSON.stringify(err));
|
2015-09-14 09:22:54 +00:00
|
|
|
},
|
|
|
|
function(file) {
|
|
|
|
expect(file).toBeDefined();
|
|
|
|
expect(file.name).toBe(fileNames[i]);
|
|
|
|
i += 1;
|
2015-08-26 14:45:13 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
}, 20000);
|
|
|
|
});
|
|
|
|
|
2015-09-14 09:22:54 +00:00
|
|
|
});
|