Navigation Menu

Skip to content

Commit

Permalink
Add test for cs-create-domain
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 6, 2012
1 parent 791fc7b commit e507546
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/cs-commands.test.js
@@ -0,0 +1,35 @@
var utils = require('./test-utils');
var assert = require('chai').assert;

var context;
var temporaryDatabase;

function commonSetup() {
temporaryDatabase = utils.createTemporaryDatabase();
context = temporaryDatabase.get();
}

function commonTeardown() {
context = undefined;
temporaryDatabase.clear();
temporaryDatabase.teardown();
temporaryDatabase = undefined;
}

suite('cs-create-domain', function() {
setup(commonSetup);
teardown(commonTeardown);

test('create', function(done) {
utils
.run('cs-create-domain',
'--domain-name', 'test',
'--database-path', temporaryDatabase.path)
.next(function(result) {
assert.equal(result.code, 0);
assert.include(result.output.stdout,
'Domain endpoints are currently being created.');
done();
});
});
});
1 change: 1 addition & 0 deletions test/test-utils.js
Expand Up @@ -178,6 +178,7 @@ function run() {
return deferred;
}
exports.run = run;
Deferred.register('run', function() { return run.apply(this, arguments); });


// activate diff for chai.assert.deepEqual
Expand Down

0 comments on commit e507546

Please sign in to comment.