Skip to content

Commit

Permalink
Add test archive
Browse files Browse the repository at this point in the history
  • Loading branch information
q2s2t committed Aug 19, 2014
1 parent ff9c620 commit f330fd7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ var fs = require('fs');
describe('`test` function', function(){

it('should get an error when 7z gets an error', function (done) {
sevenzip.test('test/resource/nothere.7z')
sevenzip.test('test/nothere.7z')
.then(null, function (err) {
expect(err.message.substr(0, 14)).to.eql('Command failed');
done();
});
});

it('should get a list of files and directories', function (done) {
sevenzip.test('test/resource/resource.7z')
sevenzip.test('test/zip.7z')
.then(function (files) {
expect(files.length).to.be.at.least(6);
done();
});
});

it('should be usable as a non-promise function', function (done) {
sevenzip.testNode('test/resource/resource.7z', function (err, files) {
sevenzip.testNode('test/zip.7z', function (err, files) {
expect(files).to.be.an('array');
done();
});
Expand All @@ -34,15 +34,15 @@ describe('`test` function', function(){
describe('`extract` function', function() {

it('should get an error when 7z gets an error', function (done) {
sevenzip.extract('test/resource/nothere.7z', '.tmp/extract')
sevenzip.extract('test/nothere.7z', '.tmp/extract')
.then(null, function (err) {
expect(err.message.substr(0, 14)).to.eql('Command failed');
done();
});
});

it('should get a list of files and directories', function (done) {
sevenzip.extract('test/resource/resource.7z', '.tmp/extract')
sevenzip.extract('test/zip.7z', '.tmp/extract')
.then(function (files) {
var t = path.resolve('.tmp/extract', files[0]);
expect(fs.existsSync(t)).to.eql(true);
Expand All @@ -53,7 +53,7 @@ describe('`extract` function', function() {

it('should be usable as a non-promise function', function (done) {
sevenzip.extractNode(
'test/resource/resource.7z',
'test/zip.7z',
'.tmp/extract',
function (err, files) {
expect(files).to.be.an('array');
Expand Down
Binary file added test/zip.7z
Binary file not shown.

0 comments on commit f330fd7

Please sign in to comment.