Skip to content

Commit

Permalink
Getting the tests running under new Logan test runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Jul 17, 2010
1 parent cfa0bd3 commit ede04f6
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion geddy-core/lib/fleegix.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions geddy-core/lib/router.js
Expand Up @@ -193,13 +193,15 @@ var Router = function () {
return false;
}

/*
// build the possibly empty query string
var qs = require('querystring').stringify(url[1]);
// if there is a query string...
if (qs.length > 0) {
return url[0] + '?' + qs;
}
*/

// just return the url
return url[0];
Expand Down Expand Up @@ -356,7 +358,7 @@ var Router = function () {
delete params[i];
}

return [ url.join(''), params ];
return [url.join(''), params];
};

this.keysAndRoutes = function () {
Expand Down Expand Up @@ -404,8 +406,7 @@ var Router = function () {
// assigning the vals from the url to the names of the keys as we go (potentially stoopid)

// let's chop off the QS to make life easier
var url = require('url').parse(urlParam);
var path = url.pathname;
var path = urlParam.split(/\?|;/)[0];
var params = {method:method};

for (var key in this.params) { params[key] = this.params[key]; }
Expand Down
6 changes: 3 additions & 3 deletions geddy-core/scripts/Jakefile.js
Expand Up @@ -71,7 +71,7 @@ task('resource', [], function (nameParam) {
var text, contents;
var filePath;
var fleegix = require('../lib/fleegix');

var ejs = require('../../geddy-template/lib/adapters/ejs/ejs');
global.geddy = require('../../geddy-core/lib/geddy');

// Add the controller file
Expand All @@ -94,7 +94,7 @@ task('resource', [], function (nameParam) {
// Grab the template text
text = fs.readFileSync(__dirname + '/gen/resource_model.ejs', 'utf8').toString();
// Stick in the model name
var templ = new fleegix.ejs.Template({text: text});
var templ = new ejs.Template({text: text});
templ.process({data: {names: names}});
filePath = './app/models/' + names.filename.singular + '.js';
fs.writeFileSync(filePath, templ.markup, 'utf8');
Expand All @@ -105,7 +105,7 @@ task('resource', [], function (nameParam) {
// Grab the template text
text = fs.readFileSync(__dirname + '/gen/resource_controller.ejs', 'utf8').toString();
// Stick in the controller name
var templ = new fleegix.ejs.Template({text: text});
var templ = new ejs.Template({text: text});
templ.process({data: {names: names}});
filePath = './app/controllers/' + names.filename.plural + '.js';
fs.writeFileSync(filePath, templ.markup, 'utf8');
Expand Down
15 changes: 5 additions & 10 deletions geddy-core/tests/test-router.js
@@ -1,14 +1,9 @@
//var ERNEST = require('../scripts/ernest').ERNEST;
//var assert = require('assert');
//var gRouter = require('../lib/router');
var geddy = {};
Router = require('../lib/router').Router;

//Load utility libraries
geddy.util = {};
logan.require('geddy.util.meta', '../../geddy-util/lib/meta');
logan.require('geddy.util.string', '../../geddy-util/lib/string');
if (typeof geddy == 'undefined') { geddy = {}; }
if (typeof geddy.util == 'undefined') { geddy.util = {}; }
geddy.util.meta = require('../../geddy-util/lib/meta');
geddy.util.string = require('../../geddy-util/lib/string');

var Router = require('../lib/router').Router;
router = new Router();

routerTests = {
Expand Down
1 change: 0 additions & 1 deletion geddy-model/lib/model.js
Expand Up @@ -45,7 +45,6 @@ geddy.model.registerModel('User');
*/

if (typeof geddy == 'undefined') { geddy = {}; }
var sys;
var _log;

geddy.model = new function () {
Expand Down
4 changes: 2 additions & 2 deletions geddy-model/tests/create_user.js
@@ -1,4 +1,5 @@
var geddy = {};
if (typeof geddy == 'undefined') { geddy = {}; }
if (typeof geddy.model == 'undefined') { geddy.model = {}; }
geddy.model = require('../lib/model');
geddy.util.date = require('../../geddy-util/lib/date');
geddy.util.meta = require('../../geddy-util/lib/meta');
Expand Down Expand Up @@ -70,4 +71,3 @@ var testCreateUser = new function () {

logan.run(testCreateUser);


7 changes: 3 additions & 4 deletions geddy-model/tests/datatypes.js
@@ -1,4 +1,6 @@
var geddy = {};
if (typeof geddy == 'undefined') { geddy = {}; }
if (typeof geddy.util == 'undefined') { geddy.util = {}; }
if (typeof geddy.model == 'undefined') { geddy.model = {}; }
geddy.model = require('../lib/model');
geddy.util.date = require('../../geddy-util/lib/date');
geddy.util.meta = require('../../geddy-util/lib/meta');
Expand All @@ -15,8 +17,6 @@ global.ByTor = function () {

geddy.model.registerModel('ByTor');

//Ernest.setup = function () {};

var testDatatypes = new function () {
this.testAllOptional = function () {
var params = {};
Expand Down Expand Up @@ -171,4 +171,3 @@ var testDatatypes = new function () {

logan.run(testDatatypes);


2 changes: 1 addition & 1 deletion geddy-template/lib/adapters/ejs/ejs.js
Expand Up @@ -354,4 +354,4 @@ ejs.Template.prototype = new function () {
};
};


module.exports = ejs;

0 comments on commit ede04f6

Please sign in to comment.