Skip to content

Commit

Permalink
Refactored tests for 0.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Serby committed Mar 22, 2012
1 parent db66483 commit 4ef6da1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/compact.test.js
Expand Up @@ -23,26 +23,26 @@ describe('compact.js', function() {

it('should error with invalid source path', function() {
(function() {
var compact = require('../../compact').createCompact('invalid src path');
var compact = require('../../compact').createCompact({ srcPath: 'invalid src path' });
}).should.throw('Invalid source path \'invalid src path\'');
});

it('should create a missing invalid destination path', function() {
var compact = require('../../compact').createCompact(srcPath, destPath + '/invalid-dest');
var compact = require('../../compact').createCompact({ srcPath: srcPath, destPath: destPath + '/invalid-dest' });
path.existsSync(destPath + '/invalid-dest').should.equal(true);
});

it('should succeed with valid paths', function() {
require('../../compact')
.createCompact(srcPath, destPath).should.be.a('object');
.createCompact({ srcPath: srcPath, destPath: destPath }).should.be.a('object');
});
});

describe('#addNamespace()', function() {
var compact;

beforeEach(function() {
compact = require('../../compact').createCompact(srcPath, destPath);
compact = require('../../compact').createCompact({ srcPath: srcPath, destPath: destPath });
});

it('should fail on null', function() {
Expand All @@ -62,7 +62,7 @@ describe('compact.js', function() {
, compact;

beforeEach(function() {
compact = require('../../compact').createCompact(srcPath, destPath);
compact = require('../../compact').createCompact({ srcPath: srcPath, destPath: destPath });
namespace = compact.addNamespace('global');
});

Expand Down Expand Up @@ -107,7 +107,7 @@ describe('compact.js', function() {
, compact;

beforeEach(function() {
compact = require('../../compact').createCompact(srcPath, destPath);
compact = require('../../compact').createCompact({ srcPath: srcPath, destPath: destPath });
});

it('should error without parameter', function() {
Expand Down

0 comments on commit 4ef6da1

Please sign in to comment.