Skip to content
Browse files

Use test/files during tests.

  • Loading branch information...
1 parent 3d3397d commit 2325969f95d6ba8f4b9836d1e56dd5ff7f01e84b @yhahn yhahn committed Feb 3, 2011
Showing with 18 additions and 2 deletions.
  1. +1 −1 server/bootstrap.js
  2. +7 −0 test/export.test.js
  3. +7 −0 test/tilemill.test.js
  4. +1 −0 tests.sh
  5. +2 −1 tilemill.js
View
2 server/bootstrap.js
@@ -1,6 +1,5 @@
var fs = require('fs'),
path = require('path'),
- models = require('models-server'),
Step = require('step');
// Bootstrap
@@ -36,6 +35,7 @@ module.exports = function(app, settings) {
}
// Create a default library for the local data directory.
+ var models = require('models-server');
var data = new models.Library({
id: 'data',
name: 'Local data',
View
7 test/export.test.js
@@ -1,4 +1,11 @@
require.paths.unshift(__dirname + '/../lib/node', __dirname + '/../');
+
+var settings = require('settings');
+settings.files = __dirname + '/files';
+settings.mapfile_dir = __dirname + '/files/.cache';
+settings.data_dir = __dirname + '/files/.cache';
+settings.export_dir = __dirname + '/files/export';
+
var assert = require('assert');
var fs = require('fs');
var _ = require('underscore')._;
View
7 test/tilemill.test.js
@@ -1,4 +1,11 @@
require.paths.unshift(__dirname + '/../lib/node', __dirname + '/../');
+
+var settings = require('settings');
+settings.files = __dirname + '/files';
+settings.mapfile_dir = __dirname + '/files/.cache';
+settings.data_dir = __dirname + '/files/.cache';
+settings.export_dir = __dirname + '/files/export';
+
var assert = require('assert');
var fs = require('fs');
var _ = require('underscore')._;
View
1 tests.sh
@@ -1,2 +1,3 @@
# Help script for running tests
+test -d test/files && rm -r test/files
NODE_ENV=test ./bin/expresso --serial --port 8889 $*
View
3 tilemill.js
@@ -14,10 +14,11 @@ app.use(express.bodyDecoder());
app.use(express.staticProvider('client'));
app.use(express.staticProvider('shared'));
+// Bootstrap must be required first and is *blocking* while it does its setup.
+require('bootstrap')(app, settings);
require('api')(app, settings);
require('tiles')(app, settings);
require('export')(app, settings);
-require('bootstrap')(app, settings);
app.error(function(err, req, res){
res.send(err, 500);

0 comments on commit 2325969

Please sign in to comment.
Something went wrong with that request. Please try again.