2013-04-09 16:02:36 +00:00
|
|
|
/**
|
|
|
|
* asteroid test setup and support.
|
|
|
|
*/
|
|
|
|
|
2013-06-07 19:57:51 +00:00
|
|
|
assert = require('assert');
|
|
|
|
asteroid = require('../');
|
2013-06-11 16:01:44 +00:00
|
|
|
memoryConnector = asteroid.Memory;
|
2013-06-24 23:30:09 +00:00
|
|
|
GeoPoint = asteroid.GeoPoint;
|
2013-06-11 18:07:49 +00:00
|
|
|
app = null;
|
2013-06-12 22:44:38 +00:00
|
|
|
TaskEmitter = require('sl-task-emitter');
|
|
|
|
request = require('supertest');
|
2013-06-07 19:57:51 +00:00
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
app = asteroid();
|
2013-06-11 16:01:44 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
assertValidDataSource = function (dataSource) {
|
|
|
|
// has methods
|
|
|
|
assert.isFunc(dataSource, 'createModel');
|
2013-06-21 23:48:53 +00:00
|
|
|
assert.isFunc(dataSource, 'discoverModelDefinitions');
|
|
|
|
assert.isFunc(dataSource, 'discoverSchema');
|
2013-07-12 19:40:36 +00:00
|
|
|
assert.isFunc(dataSource, 'enableRemote');
|
|
|
|
assert.isFunc(dataSource, 'disableRemote');
|
2013-06-11 16:01:44 +00:00
|
|
|
assert.isFunc(dataSource, 'defineOperation');
|
|
|
|
assert.isFunc(dataSource, 'operations');
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.isFunc = function (obj, name) {
|
|
|
|
assert(obj, 'cannot assert function ' + name + ' on object that doesnt exist');
|
|
|
|
assert(typeof obj[name] === 'function', name + ' is not a function');
|
|
|
|
}
|